12.8. <rich:list>
The
<rich:list> component renders a list of items. The list can be an numerically ordered list, an un-ordered bullet-point list, or a data definition list. The component uses a data model for managing the list items, which can be updated dynamically.
12.8.1. Basic usage
The
var attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the value attribute by using EL (Expression Language).
12.8.2. Type of list
By default, the list is displayed as an un-ordered bullet-point list. The
type attribute is used to specify different list types:
unordered- The default presentation. The list is presented as a series of bullet-points, similar to the
<ul>HTML element. ordered- The list is presented as a numbered series of items, similar to the
<ol>HTML element. definitions- The list is presented as a series of data definitions. Part of the data model, specified as the term, is listed prominently. The other associated data is listed after each term.The term is marked using the
termfacet. The facet is required for all definition lists. Use of the facet is shown in Example 12.13, “Data definition list”.Example 12.13. Data definition list
<h:form> <rich:list var="car" value="#{dataTableScrollerBean.allCars}" type="definitions" rows="5" title="Cars"> <f:facet name="term"> <h:outputText value="#{car.make} #{car.model}"></h:outputText> </f:facet> <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:list> </h:form>
12.8.3. Bullet and numeration appearance
The appearance of bullet points for unordered lists or numeration for ordered lists can be customized through CSS, using the list-style-type property.
12.8.4. Customizing the list
The
first attribute specifies which item in the data model to start from, and the rows attribute specifies the number of items to list. The title attribute is used for a floating tool-tip. Example 12.14, “<rich:list> example” shows a simple example using the <rich:list> component.
Example 12.14. <rich:list> example
<h:form> <rich:list var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="unordered" 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:list> </h:form>
12.8.5. Reference data
component-type:org.richfaces.Listcomponent-class:org.richfaces.component.UIListcomponent-family:org.richfaces.Listrenderer-type:org.richfaces.ListRendererhandler-class:org.richfaces.taglib.ListHandler
12.8.6. Style classes and skin parameters
Table 12.5. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties |
|---|---|---|
| generalTextColor
|
color
|
generalFamilyFont
|
font-family
| |
generalSizeFont
|
font-size
| |
| generalTextColor
|
color
|
generalFamilyFont
|
font-family
| |
generalSizeFont
|
font-size
| |
| generalTextColor
|
color
|
generalFamilyFont
|
font-family
| |
generalSizeFont
|
font-size
| |
| generalTextColor
|
color
|
generalFamilyFont
|
font-family
| |
generalSizeFont
|
font-size
|


