Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.6.7.  < rich:dataList > available since 3.0.0

The component to render unordered lists that allows choosing data from a model and obtains built-in support of Ajax updates.


The <rich:dataList> component allows to generate a list from a model.

The component has the "type" attribute, which corresponds to the "type" parameter for the <ul> HTML element and defines a marker type. Possible values for "type" attribute are: "disc", "circle", "square".

Here is an example:


...
<h:form>
        <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="disc" title="Car Store">
                <h:outputText value="#{car.make} #{car.model}"/><br/>
                <h:outputText value="Price:" styleClass="label"></h:outputText>
                <h:outputText value="#{car.price} "/><br/>
                <h:outputText value="Mileage:" styleClass="label"></h:outputText>
                <h:outputText value="#{car.mileage} "/><br/>
        </rich:dataList>
</h:form>
...

This is a result:


In the example the "rows" attribute limits a number of output elements of the list.

The "first" attribute defines the first element for output. "title" is used for a popup title. See the picture below:


The <rich:dataList> component could be partially updated with Ajax. The "ajaxKeys" attribute points to an Object (java.util.Set) that contains row keys to be updated after an Ajax request. See an example of usage the attribute in the Using the ajaxKeys attribute for <rich:dataList> article in the RichFaces Cookbook.

Table of <rich:dataList> attributes.



You can find all necessary information about style classes redefinition in Definition of Custom Style Classes section.

On the component LiveDemo page you can see the example of <rich:dataList> usage and sources for the given example.