开发者

Primefaces tree does not display on the page

I'm using primefaces 1.1jar jsf 1.2 Richfaces 3.3.3 tomcat 7.11

i have created xhtml page to display tree but on page it shows blank.

Thanks for your replies.

Xhtml:

<body>
   <h:form>
      <p:commandButton ></p:commandButton>
     <rich:menuGroup value="#{treeBean.root}"></rich:menuGroup>

     <p:tree value="#{treeBean.root}" var="node" dynamic="true">  
        <p:treeNode>  
             <h:outputText value="#{node}"/>  
        </p:treeNode>  
     </p:tree>
</h:form>
</body>

And this is managedBean clas开发者_开发问答s

import org.primefaces.model.TreeNode;
import org.primefaces.model.*;


import org.primefaces.model.DefaultTreeNode;  

public class TreeBean {  

private TreeNode root;  

public TreeBean() {  
    root = new DefaultTreeNode("Root", null);  
    TreeNode node0 = new DefaultTreeNode("Node 0", root);  
    TreeNode node1 = new DefaultTreeNode("Node 1", root);  
    TreeNode node2 = new DefaultTreeNode("Node 2", root);  

    TreeNode node00 = new DefaultTreeNode("Node 0.0", node0);  
    TreeNode node01 = new DefaultTreeNode("Node 0.1", node0);  

    TreeNode node10 = new DefaultTreeNode("Node 1.0", node1);  
    TreeNode node11 = new DefaultTreeNode("Node 1.1", node1);  

    TreeNode node000 = new DefaultTreeNode("Node 0.0.0", node00);  
    TreeNode node001 = new DefaultTreeNode("Node 0.0.1", node00);  
    TreeNode node010 = new DefaultTreeNode("Node 0.1.0", node01);  

    TreeNode node100 = new DefaultTreeNode("Node 1.0.0", node10);  
}  

public TreeNode getRoot() {  
    return root;  
}  

}

p:commandButton is working, i created it only for testing.But tree is blank.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜