JBoss.orgCommunity Documentation
The component to render unordered lists that allows choosing data from a model and obtains built-in support of Ajax updates.
A completely skinned list and child elements
Possibility to update a limited set of rows with Ajax
Possibility to receive values dynamically from a model
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.
Table 6.42. Component Identification Parameters
Name | Value |
---|---|
component-type | org.richfaces.DataList |
component-class | org.richfaces.component.html.HtmlDataList |
component-family | org.richfaces.DataList |
renderer-type | org.richfaces.DataListRenderer |
tag-class | org.richfaces.taglib.DataListTag |
Table 6.43. Style classes (selectors) without skin parameters
Class name | Description |
---|---|
.rich-datalist | Defines styles for an html <ul> element |
.rich-list-item | Defines styles for an html <li> element |
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.