January 2013
Intermediate to advanced
328 pages
7h 14m
English
Multi-themable web applications require a theme switcher component. The default PrimeFaces' theme switcher is a component, which enables switching themes on the fly without a round-trip to the server. We speak about a stateless theme switcher because the current selected theme is only known on the client side.
In this recipe, we will show the usage of such a stateless theme switcher.
The theme switcher usage is very similar to the usage of p:selectOneMenu. The component is represented by the p:themeSwitcher tag and accepts f:selectItem or f:selectItems.
<p:themeSwitcher style="width:165px" effect="fade"> <f:selectItem itemLabel="Choose Theme" itemValue=""/> <f:selectItems value="#{userSettingsController.themes}"/> ...Read now
Unlock full access