0 Replies Latest reply on Mar 6, 2008 8:24 AM by florencio.bueno

    How show the text in the tree from scratch

    florencio.bueno

      I build the following code to build a tree from my java code

      //CustomNode implements the interface TreeNode
      CustomNode treeNodes = getCustomNode();//Bring all data to the tree

      HtmlTree tree = new HtmlTree();
      tree.setValue(treeNodes);
      tree.setVar("item");

      HtmlTreeNode treeNode = new HtmlTreeNode();

      HtmlOutputText output = new HtmlOutputText();
      output.setValue("test");//message text to test, the tree should be have only elements wich a text 'teste'
      //realy i need something like output.setValue("#{item.vo.description}");

      treeNode.getChildren().add(output);

      tree.getChildren().add(treeNode);

      //I have a tree like this
      br.com.company.project.module.controller.CustomNode@d89e2
      --br.com.company.project.module.controller.CustomNode@d75fbd
      --br.com.company.project.module.controller.CustomNode@1ce9bc8
      --br.com.company.project.module.controller.CustomNode@155851e

      Why the text from the tree is the object address ?
      How I can do some like #{item.vo.description} and show, in the node, the text from the CustomNode ?

      I do this code based on the code bellow
      <rich:tree
      var="item"
      value="#{myController.treeNodes.data}">
      <rich:treeNode>
      <h:outputText value="#{item.vo.name}"/>
      </rich:treeNode>
      </rich:tree>