O'Reilly logo

PrimeFaces Cookbook by Mert Çalışkan, Oleg Varaksin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required