O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

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

Introducing SelectOneListbox

The SelectOneListbox component is an extended version of the standard SelectOneListbox component with theme integration. Basic usage of <p:selectOneListbox> is as follows:

<p:selectOneListbox value="#{selectionController.number}">
    <f:selectItem itemLabel="One" itemValue="1" />
    <f:selectItem itemLabel="Two" itemValue="2" />
    <f:selectItem itemLabel="Three" itemValue="3" />
</p:selectOneListbox>

The preceding <p:selectOneListbox> component will be rendered as shown in the following screenshot:

Introducing SelectOneListbox

We can also use POJOs to populate <p:selectOneListbox> options. Let us see how to populate SelectOneListbox using POJOs.

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