0 Replies Latest reply on May 7, 2009 8:05 AM by Erik Brink

    TreeNodeImpl using commandLink for events

    Erik Brink Newbie

      I have seen examples do the following inside webpages

      <h:treenode>
       <commandLink>
       <h:outputText />
       </h:commandLink>
      </h:treenode>


      Now I am wondering if this is possible in just java aswell.
      Currently we are building a tree as:
      HtmlTree tree = new HtmlTree();
       tree.setValue(getData());
       this.getChildren().add(tree);


      getData builds TreeNodeImpl like:
      TreeNodeImpl<Module> rootNode = new TreeNodeImpl<Module>();
       Module rootModule = new Module("root", "hidden", "");
       rootNode.setData(rootModule);
      
       TreeNodeImpl<Module> testNode = new TreeNodeImpl<Module>();
       Module test = new Module("module", "WORKSHOP", "");
       testNode.setData(test);
       rootNode.addChild(testNode.getData(), testNode);
      
       return rootNode;
      


      What I would like is that only my leafs will fire an event instead of everything when I use the nodeSelectedListener.
      When I use TreeNodeImpl I run into the problem that I can't get it to fire an action to the actionListener that I set (a backingBean). And on top of that I can't manage to get a htmlOutputText pasted on it to make it look nice in our tree.

      Has anyone tried to do this before? I could really use some help figuring out why I am not getting an event, and how to rectify that.