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:

How to do it...

There's more...

The type attribute defines how the list should be presented. The values for the attribute can be unordered, ordered, ...

Get PrimeFaces Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.