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 SplitButton

Let us see how we can use the <p:splitButton> component, by performing the following step:

  1. Create a form with the <p:splitButton> component with My Account as the default action, and Change Password and Logout as other options:
    <h:form>
        <p:splitButton value="My Account" actionListener="#{selectionController.showAccount}" >  
            <p:menuitem value="Change Password" url="changePwd.jsf" />  
            <p:menuitem value="Logout" ajax="false"  actionListener="#{selectionController.logout}"/>  
        </p:splitButton>
    </h:form>

What the just happened?

The preceding code displays SplitButton as shown in the following screenshot:

What the just happened?

We have used <p:splitButton> ...

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