list.xhtml 1.45 KB
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
	xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="#{sessionHandler.template}">
		<f:metadata>
			<f:event type="preRenderView" listener="#{menuListView.initList}" />
		</f:metadata>

		<ui:define name="content">
			<h1>#{i18n['menulist.header']}</h1>
			<h:panelGrid columns="2">
				<h:form>
					<p:tree value="#{menuListView.root}" var="node" id="tree" selectionMode="single" selection="#{menuListView.selectedNode}">
						<p:treeNode id="treeNode">
							<h:outputText value="#{i18n[node.key]}" id="lblNode" />
						</p:treeNode>
					</p:tree>
					<h:commandButton value="Display Selected" actionListener="#{menuListView.showMenuitem()}" id="btnDisplay" />
				</h:form>

				<h:form rendered="#{menuListView.selectedMenuitemAvailable}">
					<h:panelGrid columns="3">
						<h:outputLabel for="key" value="#{i18n['menuitem.key']}" />
						<h:outputText id="key" value="#{menuListView.selectedMenuitem.key}" />
						<h:message for="key" />
					</h:panelGrid>
				</h:form>
			</h:panelGrid>
		</ui:define>
	</ui:composition>
</h:body>
</html>