View Source

h2. Overview
_Since 4.2_

You can use _icecore:repeat_ tag to iterate its child components over the items of a data source (such as java.util.Collection, array or java.sql.ResultSet). It can also provides iteration information by means of a additional variable.

{tip}See the ICEfaces Showcase [Live Demo|http://icefaces-showcase.icesoft.org/showcase.jsf?grp=icecore:repeat] of this component, complete with source code.{tip}

h2. Getting Started

To use the _icecore:repeat_ tag, first declare the core namespace:

{panel}
{code:html|borderStyle=dashed}<html ... xmlns:icecore="http://www.icefaces.org/icefaces/core">
{code}
{panel}
Then add the tag to your page markup and define the interval (in seconds) after which the markup should be made visible:

{panel}
{code:xml|borderStyle=dashed}<h:body>
...
<table>
...
<tbody>
<icecore:repeat value="#{test.items}" var="item" varStatus="status">
<tr>
<td><h:outputText value="#{item}"/></td>
<td><h:outputText value="#{status.index}"/></td>
<td><h:outputText value="#{status.first}"/></td>
<td><h:outputText value="#{status.last}"/></td>
</tr>
</icecore:repeat>
</tbody>
</table>
...
</h:body>
{code}
{panel}

h2. Attributes

{tip:title=TagLib Documentation}This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available [here|http://res.icesoft.org/docs/v4_latest/core/comps/tld/icecore/idleMonitor.html].{tip}

{panel}
*var* Use this attribute to specify the the request-scope attribute under which the current item will be exposed when iterating.
{panel}
{panel}
*varStatus* Use this attribute to specify a the request-scope attribute under which the iteration status for the current item will be exposed. When not specified the request-scope attribute is not set.
{panel}
{panel}
*first* Use this attribute to specify a zero-relative index of the first item to be displayed. When not specified the default value is "0".
{panel}
{panel}
*rows* Use this attribute to specify a the number of rows to be displayed. When not specified the default value is the maximum number of available items.
{panel}