Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-3699

UITree.getTreeNode() returns always null

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3.0
    • Component/s: doc
    • Labels:
      None
    • Environment:

      Tomcat, JFS SUN RI, Facelets

    • Workaround Description:
      Hide

      Using the follow I got the data from the selected node:

      final Object rowKey = theTree.getRowKey();

      // this works
      final Object rowData = theTree.getRowData(rowKey);

      Show
      Using the follow I got the data from the selected node: final Object rowKey = theTree.getRowKey(); // this works final Object rowData = theTree.getRowData(rowKey);

      Description

      If have a node selection listener on my rich:tree:

      <rich:tree switchType="server"
      nodeSelectListener="#

      {treeMgrt.onSelect}

      "
      >

      <rich:recursiveTreeNodesAdaptor roots="#

      {treeMgrt.roots}

      " var="item" nodes="#

      {item.nodes}

      ">

      <rich:treeNode>
      <h:outputText value="#

      {item}

      "/>
      </rich:treeNode>

      </rich:recursiveTreeNodesAdaptor>
      </rich:tree>

      If the onSelect(NodeSelectedEvent event) is called I do the following:
      ....
      final UITree theTree = this.getTree(event);
      final TreeNode treeNode = theTree.getTreeNode();
      ....

      treeNode is evey time null. Also If I use the method with rowKey. I have had a look into the basic implementation and found follow code:

      StackingTreeModel.java:

      public TreeNode getTreeNode() {
      if (isRowAvailable())

      { return null; }

      throw new IllegalStateException(
      "No tree element available or row key not set!");
      }

      The method isRowAvailable() returns true and the result is a null object.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                artdaw Gleb Galkin
                Reporter:
                waffel Thomas Wabner
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: