O'Reilly logo

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

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

A collection of data in a list layout is presented by dataList with several display types and features, such as AJAX pagination.

How to do it…

A basic definition of a data list with a header facet for listing the names of countries starting with the letter "A" would be as follows:

<p:dataList id="simple" value="#{dataListBean.countriesShort}"
  var="country" itemType="disc">
  <f:facet name="header">
    Countries starting with 'A'
  </f:facet>
  <h:outputText value="#{country}" />
</p:dataList>

By default, the dataList component renders an unordered list, which corresponds to the <ul> HTML tag. The visual output is given here:

How to do it…

The bullet ...

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