Introducing the DataList component
The DataList component displays a collection of data in the list layout with several display types and supports AJAX pagination. The DataList component iterates through a collection of data and renders its child components for each item.
Let us see how to use <p:dataList>
to display a list of tag names as an unordered list:
<p:dataList value="#{tagController.tags}" var="tag" type="unordered" itemType="disc"> #{tag.label} </p:dataList>
The preceding <p:dataList>
component displays tag names as an unordered list of elements marked with disc
type bullets. The valid type
options are unordered
, ordered
, definition
, and none
.
We can use type="unordered"
to display items as an unordered collection along with various itemType
options such as disc
, circle
, and square
. By default, type
is set to unordered
and itemType
is set to disc
.
We can set type="ordered"
to display items as an...