Element Details: Repeat+Elements
 Back


Available in: Logi Info Source code name: RepeatElementsIntroduced in: v11.1.033

Repeat Elements make it possible to dynamically replicate definition elements from rows of a child datalayer. This makes it easy for a definition to change based on a data query. For example, additional Data Table Columns can be added if a database schema query indicates that there are extra columns in a table.

Similar to @Data tokens, @Repeat tokens set attribute values from data for each of the repeated elements.

Repeat Elements should have one child datalayer element, and one or more other elements which will be repeated. Here is a simple example which lists Category Names. Note how the Label element's Caption is changed with each repeat.

<RepeatElements ID="RepeatCategories">
<DataLayer Type="SQL" Source="SELECT CategoryName from Categories">
</DataLayer>
<Label Caption="Category Name: @Repeat.CategoryName~" />
<LineBreak />
</RepeatElements>

Repeat Elements may be placed anywhere within a definition.

Repeat Elements can also be nested. The easiest way is to include an additional Repeat Elements below the first. This method works well as long as there are not too many Repeat Elements, each running its own datalayer.

To build nested repeated elements with a single datalayer, add the datalayer to the top-level Repeat Elements and set it up with a Group Filter element with Hierarchical="True". The lower-level Repeat Elements will automatically repeat based on the next hierarchical level.

<RepeatElements ID="RepeatCountries">
<DataLayer Type="SQL" Source="Select Customers.ContactName, Customers.Country From Customers">
<GroupFilter GroupColumn="Country" Hierarchical="True" />
</DataLayer>
<Label Caption="@Repeat.Country~" />
<LineBreak />
<RepeatElements ID="RepeatContacts">
<Spaces Size="5" />
<Label Caption="@Repeat.ContactName~" />
<LineBreak />
</RepeatElements>
</RepeatElements>




ATTRIBUTES

Click attribute Name to drill down for more information.

NamePossible ValuesDescription
ID
UserDefined
(Required) The ID attribute is a pervasive attribute that uniquely identifies an element within a definition file. The ID needs to be a unique value within the definition.



PARENT ELEMENTS

Click element to drill down for more information.



CHILD ELEMENTS

Click element to drill down for more information.



 Back to top