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 orderList

The orderList component is used to sort a collection with the support of drag-and-drop reordering, transition effects, and POJO support.

How to do it…

A basic definition for the orderList that sorts a collection of strings would be as shown here:

<p:orderList id="simple" value="#{orderListBean.countries}"
  var="country" itemLabel="#{country}" itemValue="#{country}" />

The visual output of the component will be as shown here:

How to do it…

There's more…

To define a header on top of orderList, a facet with the name caption should be provided as shown here:

<p:orderList id="withCaption" value="#{orderListBean.countries}" var="country" itemLabel="#{country}" ...

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