O'Reilly logo

PrimeFaces Theme Development by Sudheer Jonna, Andy Bailey

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

Adding buttons that change the theme without using ThemeSwitcher

We are now going to add code to the morecomponents.xhtml page, which allows us to switch themes without using the ThemeSwitcher component. We are going to add them at the end because the code needs to be explained so that you have a clear understanding of how this is done. I chose commandButton for the task, but we just as easily could have used other components that support the action attribute and have the ability to cause the page to be requested in full or allow us to update the entire page using an AJAX request.

Here is the code that we need to add immediately after the form tag with id="mainform":

<p:panelGrid columns="3"> <p:column> <p:commandButton ajax="false" value="Switch ...

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