I have a screen using <p:layout>. In left layout unit, there is a navigation tree. On initial load of the screen, there is nothing on the right side. When a tree node is clicked, the right side shows content with p:picklist .
Main screen code:
Code: Select all
<ui:define name="leftnav" id="leftnav">
<ui:include src="/main/section/menu.xhtml"/>
</ui:define>
<ui:define name="content">
<ui:include src="#{treeBean.centerSrc}" />
</ui:define>
Navigation tree code:
Code: Select all
<h:form>
<p:tree value="#{treeBean.root}" var="node"
selectionMode="single" selection="#{treeBean.selectedNode}" nodeSelectListener="#{treeBean.onNodeSelect}"
update="@none"
onselectComplete="updateCenter()">
<p:treeNode>
<h:outputText value="#{node.nodeName}"/>
</p:treeNode>
</p:tree>
<p:remoteCommand name="updateCenter" update="contentUnit"/>
</h:form>
Code: Select all
<link type="text/css" rel="stylesheet" href="/myapp/faces/javax.faces.resource/picklist/picklist.css?ln=primefaces&v=2.2.RC2" />
<script type="text/javascript" src="/myapp/faces/javax.faces.resource/picklist/picklist.js?ln=primefaces&v=2.2.RC2"></script>
But this way doesn't look good for me. when other component is required in subsequent pages, I have to add more and more dummy components into initial page.
Is there any better way to get the picklist work properly?
Thanks