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 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 sorting a collection of strings would be as follows:

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

The output of the code is given as follows:

How to do it...

There's more...

With the controlsLocation attribute, we can control the position of the controls. The default value is left; other possible values are right and none.

Transition effects

Effects can be applied with the effect attribute ...

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