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

Time for action – using SelectOneMenu with editable and filter features

Let's look at how to create a drop-down menu with editable options, by performing the following step:

  1. Create a SelectOneMenu drop-down list using the editable and filter attributes:
    <p:selectOneMenu value="#{selectionController.selectedOption}" effect="fade" editable="true" filter="true" filterMatchMode="startsWith">  
        <f:selectItem itemLabel="Select One" itemValue="" />
        <f:selectItem itemLabel="One" itemValue="One" />
        <f:selectItem itemLabel="Two" itemValue="Two" />
        <f:selectItem itemLabel="Three" itemValue="Three" />  
    </p:selectOneMenu>

What just happened?

As we have set the editable attribute to true, we can select an existing option, select and edit an existing option, or write ...

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