Java Reference
In-Depth Information
Then, we need to modify our template client to allow the user to change the theme:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<body>
<f:view contracts="#{themeSelector.themeName}">
<ui:composition template="/template.xhtml">
<ui:define name="top">
<h:form>
<h:outputLabel for="themeSelector"
value="Select a theme"/>
<h:selectOneMenu id="themeSelector"
value="#{themeSelector.themeName}">
<f:selectItem itemLabel="normal"
itemValue="normal"/>
<f:selectItem itemLabel="dark"
itemValue="dark"/>
</h:selectOneMenu>
<h:commandButton value="Submit"
action="resourcelibrarycontractsdemo"/>
</h:form>
</ui:define>
<ui:define name="content">
<p>
<!-- Lorem Ipsum omitted for brevity -->
</p>
</ui:define>
</ui:composition>
</f:view>
</body>
</html>
 
Search WWH ::




Custom Search