6.6.13. < a4j:repeat > available since 3.0.0

### Create new RichFaces Documentation Jira issue

Summary
255 characters left
Description
Environment
This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.org Community Documentation

- Prev
- Next

### 6.6.13. < a4j:repeat > available since 3.0.0

expand all

#### 6.6.13.1. Description

The <a4j:repeat> component implements a basic iteration component that allows to update a set of its children with Ajax.

#### 6.6.13.2. Details of Usage

The <a4j:repeat> component is similar to Facelets <ui:repeat> tag, which is used to iterate through a collection of objects binded with JSF page as EL expression. The main difference of the <a4j:repeat> is a possibility to update particular components (it's children) instead of all using Ajax requests. The feature that makes the component different is a special "ajaxKeys" attribute that defines row that are updated after an Ajax request. As a result it becomes easier to update several child components separately without updating the whole page.

    ...

    <table>

          <tbody>

                <a4j:repeat value="#{repeatBean.items}" var="item" ajaxKeys="#{updateBean.updatedRow}">

                      <tr>

                            <td><h:outputText value="#{item.code}" id="item1" /></td>

                            <td><h:outputText value="#{item.price}" id="item2" /></td>

                      </tr>

                </a4j:repeat>

          </tbody>

    </table>

     ...

The example above points to a method that contains row keys to be updated.

## Note:

The <a4j:repeat> component is defined as fully updated, but really updated there are only the row keys which defined in the "ajaxKeys" attribute.

One more benefit of this component is absence of strictly defined markup as JSF HTML DataTable and TOMAHAWK DataTable have. Hence the components could be used more flexibly anywhere where it's necessary to output the results of selection from some collection.

If you want to output a collection as a plain HTML list, use the following structure:

    ...

    <ul>

          <a4j:repeat ...>

            <li>...<li/>

                       ...

            <li>...<li/>

          </a4j:repeat>

    </ul>

    ...

All other general attributes of the component are defined according to the similar attributes of iterative components ( <h:dataTable> or <ui:repeat> ) and are used in the same way.

#### 6.6.13.3. Reference Data

Table of <a4j:repeat> attributes.

Table 6.63. Component Identification Parameters

Name | Value
--- | ---
component-type | org.ajax4jsf.Repeat
component-family | javax.faces.Data
component-class | org.ajax4jsf.component.html.HtmlAjaxRepeat
renderer-type | org.ajax4jsf.components.RepeatRenderer

#### 6.6.13.4. Relevant Resources Links

Visit the Repeat page at RichFaces LiveDemo for examples of component usage and their sources.

Here you can find information why you can't use <a4j:repeat> to iterate the menuItems, tabs and way to solve this problem.

- Prev6.6.12. < rich:extendedDataTable > ...
- Top of page
- Front page
- Next6.6.14. < rich:scrollableDataTable >...