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

Creating drop-down lists using SelectOneMenu

The SelectOneMenu component is an extended version of the standard SelectOneMenu component with theme integration. We can create a basic drop-down list using <p:selectOneMenu> as follows:

<p:selectOneMenu value="#{selectionController.number}">
    <f:selectItem itemLabel="Select One" itemValue="" />
    <f:selectItem itemLabel="One" itemValue="1" />
    <f:selectItem itemLabel="Two" itemValue="2" />
    <f:selectItem itemLabel="Three" itemValue="3" />
</p:selectOneMenu>
Creating drop-down lists using SelectOneMenu

The <p:selectOneMenu> component provides the following attributes to customize it's behavior:

  • effect: Name of the toggle animation. Default value is fade ...

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