Tobago Demo

Menu

For Each

Generating content with a loop can be done with the <c:forEach/> tag and with the <ui:repeat/> tag.

Tag Library Documentation: <c:forEach/> | <ui:repeat/>

Example

The following example show three rivers with their length and average dischage by default.

New River

You can add a new river to the list or reset the list to the default value of 'Nile', 'Amazon' and 'Yangtze'.

For Each

The rivers are displayed as <tc:box/> tags withing a <tc:segmentLayout/>.

<tc:segmentLayout medium="6seg 6seg"> <c:forEach items="#{forEachController.rivers}" var="river"> <tc:box label="#{river.name}"> ...

Nile

6853 km 2830 m³/s

Amazon

6437 km 209000 m³/s

Yangtze

6300 km 30166 m³/s

UI:Repeat

In this example, the each data of a river is put in a <tc:section/>

<ui:repeat value="#{forEachController.rivers}" var="river"> <tc:section label="#{river.name}"> ...

Nile

6853 km 2830 m³/s

Amazon

6437 km 209000 m³/s

Yangtze

6300 km 30166 m³/s
© 2005-2023 Apache Software Foundation, Licensed under the Apache License, Version 2.0.