The <netui-data:repeater> tag iterates over a data set to render it as HTML.
<netui-data:repeater
dataSource="expression_datasource"
[defaultText="string_defaultText"]
[ignoreNulls="boolean_ignoreNulls"] />
The <netui-data:repeater> tag iterates over a data set to render it as HTML. The HTML is specified either directly within the the body of <netui-data:repeater> tag or within an associated set of "helper" tags. The "helper" tags are listed below.
Tag Description <netui-data:repeaterHeader> Renders once at the start of the iteration. <netui-data:repeaterItem> Renders once for each iteration. <netui-data:repeaterFooter> Renders once at the end of the iteration. <netui-data:pad> Used to convert irregular data sets into regular data sets through padding or truncating the output. <netui-data:choice> Used to conditionally render data in the data set based on the result of calling a decision method. This is allowed only within the <netui-data:repeaterItem> tag. <netui-data:choiceMethod> Used to define the decision method used when conditionally rendering data. This is allowed only within the <netui-data:repeaterItem> tag.
The <netui-data:repeater> tag can render in two modes; the first mode is a simple mode where the body of the <netui-data:repeater> tag is rendered once for each item in the data set. In this case, none of the other tags above are present in the repeater body. For example, the following will render the items in the "customers" data set as an unordered HTML list.
<ul> <netui-data:repeater dataSource="{pageFlow.customers}"> <li><netui:label value="{container.item.lastName}, {container.item.firstName}"/></li> </netui-data:repeater> </ul>
The second mode is a more structured mode of rendering where the "helper" tags are used to define the rendering of the data set. In this case, if one of the helper tags is present, any HTML markup directly in the body of the <netui-data:repeater> tag is not rendered; rather, the HTML markup inside the helper tags is rendered.
For example, the following will render the same output as the example shown above, but it uses the "helper" tags for rendering the HTML markup:
<netui-data:repeater dataSource="{pageFlow.customers}"> <netui-data:repeaterHeader> <ul> </netui-data:repeaterHeader> <netui-data:repeaterItem> <li><netui:label value="{container.item.lastName}, {container.item.firstName}"/></li> </netui-data:repeaterItem> <netui-data:repeaterFooter> </ul> </netui-data:repeaterFooter> </netui-data:repeater>
<netui-data:repeater dataSource="{pageFlow.myDataSet}"> <netui-data:repeaterHeader> <table border="1"> <tr> <td><b>index</b></td> <td><b>name</b></td> </tr> </netui-data:repeaterHeader> <netui-data:repeaterItem> <tr> <td> <netui:label value="{container.index}" /> </td> <td> <netui:label value="{container.item}" /> </td> </tr> </netui-data:repeaterItem> <netui-data:repeaterFooter> </table> </netui-data:repeaterFooter> </netui-data:repeater>
<netui-data:repeater> Tag Sample
Presenting Complex Data Sets in JSPs (Repeater Tags section)