Tying Page Elements to Data : Displaying Lists

Displaying Lists
When you tie a Page element to a particular data object, you need to know whether the object is a single object or a list of objects. The Page Editor does not make this distinction for you, so you need to keep track of this yourself.
Use a grid layout to unpack a list of objects on a Page. A grid layout is a special type of group layout that is designed to iterate over each object in the list. To make this work, you make the Message Refs for the items in the grid relative to the Message Ref for the grid itself (except for buttons and links). The following figure shows a list in the Page Editor. This list displays three columns from a table called product.
The important thing to notice about the list shown in the preceding figure, is the Message Ref properties for the grid and the text outputs and the Label Ref property for the grid link:
The grid’s Message Ref property is set to the Message Part called product in the Page Message.
Each text output has a Message Ref property set to the corresponding column in the data table. When you set these Message Refs you must use a relative path (.). If you select an absolute path (\) the output does not iterate over the rows of data.
The “grid link” in the list allows the user to select a particular item in the list. In this example, the grid link is tied to the productID column in the product table. The Label Ref property (not the Message Ref property) ties the link to the relevant column in the table. The Label Ref must be relative to the Message Ref for that Page element, not the Message Ref of the parent element.
Because this is a Submit, the Message Ref property specifies the object that becomes the “selected” object when the user clicks the link (Identifying a Single Object in a List of Objects). Notice that the Message Ref property is not specified for the grid link. In this example, the Message Ref property is inherited from the grid layout.
The following figure shows what the list might look like in the browser.
<<too small>>
Related Topics:
Page Message
Message Refs
Relative or Absolute References
Displaying Lists
Identifying a Single Object in a List of Objects
Buttons and Links

ActiveGrid
ActiveGrid Documentation
Version 2.0