3 Replies Latest reply on Nov 30, 2009 9:20 AM by Ilya Shaikovsky

    How add links to Tree

    Kushan Jayathilake Newbie

      Hi Guys,

      I have crated a <rich:tree> with backing bean, and have hard coded tree's values like below

       public TreeManagedBean() {
      
       rootAdmin.setData("Administrator");
       rootAccounts.setData("Accounts");
       rootOther.setData("Other");
       rootChangePwd.setData("Change Password");
      
       nodes.addChild(0, rootAdmin);
       nodes.addChild(1, rootAccounts);
       nodes.addChild(2, rootOther);
       nodes.addChild(3, rootChangePwd);
      
       TreeNodeImpl<String> childCompany = new TreeNodeImpl<String>();
       childCompany.setData("Company");
       rootAccounts.addChild(0, childCompany);
      
       TreeNodeImpl<String> childLicence = new TreeNodeImpl<String>();
       childLicence.setData("Licence Management");
       rootAccounts.addChild(1, childLicence);
      
       TreeNodeImpl<String> childFunction = new TreeNodeImpl<String>();
       childFunction.setData("Functions");
       rootAccounts.addChild(2, childFunction);
      
       TreeNodeImpl<String> childRoles = new TreeNodeImpl<String>();
       childRoles.setData("Roles");
       rootAccounts.addChild(3, childRoles);
      
       TreeNodeImpl<String> childCountry = new TreeNodeImpl<String>();
       childCountry.setData("Country");
       rootOther.addChild(0, childCountry);
      
       }
      


      and in JSP

      <rich:tree value="#{treeManagedBean.nodes}" var="node" adviseNodeOpened="true" >
       <rich:treeNode >
       <a4j:commandLink value=""></a4j:commandLink>
       <h:outputText value="#{node}" />
       </rich:treeNode>
      </rich:tree>
      


      Problem is how can load a page once i click the tree node ( add a link there) through backing bean, since backing bean feeds the data to the Tree.