I am using primefaces 3.1 with `, having four positions. In the west position(west) I have added tree menu. JSF code is follows
<p:layoutUnit position="west" size="200" header="Left"
resizable="true" collapsible="true">
<h:form>
<p:tree dynamic="true" value="#{treeBean.root}" var="node" id="tree"
selectionMode="single">
<p:treeNode id="treeNode">
<h:outputText value="#{node}" id="lblNode" />
</p:treeNode>
</p:tree>
</h:form>
</p:layoutUnit>
and in the TreeBean I have
root = new DefaultTreeNode("Root", null);
TreeNode node0 = new DefaultTreeNode("Color", root);
TreeNode node00 = new DefaultTreeNode("Red", node0);
TreeNode node01 = new DefaultTreeNode("Blue", node0);
TreeNode node02 = new DefaultTreeNode("Green", node0);
Is it possible to have navigation when I expand and click one of those nodes and upon clicking respective nodes how could I display jsf pages in the center position of layout. i.e. if I click node Blue, ideally I would like to have another jsf page being loaded into the center position of layout.
Any help is highly appreciable.
Thanks
Update 1
I have added the following code and it does a navigation to start.xhtml. However start.xhtml is displayed not inside my layout, start.xhtml is displayed as a new page.
public void onNodeSelect(NodeSelectEvent event) {
try {
System.out.println(" here " + event.getTreeNode().getData());
FacesContext
.getCurrentInstance()
.getApplication()
.getNavigationHandler()
.handleNavigation(FacesContext.getCurrentInstance(),
"null", "/start.xhtml?faces-redirect=true");
} catch (Exception e) {
logger.info("error "+e.getMessage());
// TODO: handle exception
}