1 Reply Latest reply on May 21, 2007 4:32 PM by Eric Ray

    how do i get the rowKey from a nodeSelectionEvent

    Eric Ray Novice

      I need to grab the actual object that implements the TreeNode interface and I don't see an API to do this. Does anyone know how. Currently, I'm walking through the ojbect structure in the debugger but I still don't see a way to do this.

      Thanks.

        • 1. Re: how do i get the rowKey from a nodeSelectionEvent
          Eric Ray Novice

          I better way to phrase this question is how do I get my EJB that is bound to the richfaces treeNode component.

          After a bit of reverse engineering and combing the data structure in memory...well...here is the answer...

           public void nodeSelected(NodeSelectedEvent event) {
           HtmlTreeNode node = (HtmlTreeNode)event.getSource();
           HtmlTree tree = (HtmlTree)node.getParent();
           Object o = tree.getRowData();
           MyObject mo = (MyObject)o;
           mo.businessLogic();
           }