开发者

Link a treenode(Primefaces) to an xhtml page

i have created the tree with its nodes and i would l开发者_如何学运维ike to put an action on each node to move it to an xhtml form say(ManageUser.xhtml) when i click on the node(say Manage User).


See this example from the Primefaces showcase.

You could use a select listener and redirect from the backing bean method:

<p:tree value="#{treeBean.root}" var="node"  
            selectionMode="single"  
            selection="#{treeBean.selectedNode}"  
            nodeSelectListener="#{treeBean.onNodeSelect}">  
        <p:treeNode>  
            <h:outputText value="#{node}" />  
        </p:treeNode>  
</p:tree>

and in the bean:

public void onNodeSelect(NodeSelectEvent event) {  
        FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Selected", event.getTreeNode().getData().toString());  
        // redirect here
}  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜