Listing data with dataList
dataList
presents a collection of data in the list layout, with several display types and features such as AJAX pagination.
How to do it...
A simple definition for a data list with a header facet for listing countries starting with the letter "A" would be as follows:
<p:dataList value="#{dataListController.countriesShort}" var="country" itemType="disc"> <f:facet name="header"> Countries starting with 'A' </f:facet> #{country} </p:dataList>
The appearance of the component would be as follows:
There's more...
The type
attribute defines how the list should be presented. The values for the attribute can be unordered
, ordered
, definition
, or none
. The default value is unordered
. When the value of the type
attribute is set to ordered
, the list will be rendered with numbers. This does not mean that the items of the list will be ordered according to their content. When the value of the type
attribute is set to definition
, it will display an inline description...