title: RichFaces rich:tree nodeSelectListener not being listened to
body: <p>I have a <code>rich:tree</code> component used like so:</p>
  
  <pre><code>                    &lt;rich:tree switchType="client" value="#{MyBacking.logTree}"
                      reRender="selectedLog" var="item" nodeFace="#{item.type}"
                      nodeSelectListener="#{MyBacking.processLogSelection}"
                      style="width: 50px;"&gt;
                      &lt;rich:treeNode type="folder"
                          icon="/img/logListFolderIconClosed.png"
                          iconLeaf="/img/logListFolderIconOpen.png"&gt;
                          &lt;h:outputText value="#{item.name}" /&gt;
                      &lt;/rich:treeNode&gt;
                      &lt;rich:treeNode type="log" iconLeaf="/img/logFileIcon.png"
                          icon="/img/logFileIcon.png"&gt;
                          &lt;h:outputText value="#{item.name}" /&gt;
                      &lt;/rich:treeNode&gt;
                  &lt;/rich:tree&gt;
  </code></pre>
  
  <p>and my MyBacking processLogSelection() method is:</p>
  
  <pre><code>    public void processLogSelection(NodeSelectedEvent event) {
      logger.info("In processLogSelection");
      HtmlTree tree = (HtmlTree) event.getComponent();
      nodeTitle = (String) tree.getRowData();
      selectedNodeChildren.clear();
      TreeNode currentNode = tree.getModelTreeNode(tree.getRowKey());
      if (currentNode.isLeaf()){
          selectedNodeChildren.add((String)currentNode.getData());
      } else {
          Iterator&lt;Map.Entry&lt;Object, TreeNode&gt;&gt; it = currentNode.getChildren();
          while (it != null &amp;&amp; it.hasNext()) {
              Map.Entry&lt;Object, TreeNode&gt; entry = it.next();
              selectedNodeChildren.add(entry.getValue().getData().toString()); 
              logger.info("selected node: " + entry.getValue().getData().toString());
          }
      }
  }
  </code></pre>
  
  <p>But when the page renders the tree (fine) clicking on a node highlights the node but nothing is logged from either of the bean logger calls - the method is just not being called.  Any help answering why this might be would be greatly appreciated.
  Mark</p>
  
  <p><strong>EDIT</strong> Added suggested tags/simplified bean method - still doesn't appear to get response from the bean as far as logs go:</p>
  
  <pre><code>            &lt;h:panelGrid columns="2" border="0" width="100%" rowClasses="tt"&gt;
              &lt;rich:panel styleClass="panelLogTree" header="Log Select"&gt;
                  &lt;h:form&gt;
                      &lt;rich:tree switchType="client" value="#{MyBacking.logTree}"
                          var="item" nodeFace="#{item.type}" reRender="selectedLog"
                          nodeSelectListener="#{MyBacking.processLogSelection}"
                          ajaxSubmitSelection="true" style="width: 50px;"&gt;
                          &lt;rich:treeNode type="folder"
                              icon="/img/logListFolderIconClosed.png"
                              iconLeaf="/img/logListFolderIconOpen.png"&gt;
                              &lt;h:outputText value="#{item.name}" /&gt;
                          &lt;/rich:treeNode&gt;
                          &lt;rich:treeNode type="log" iconLeaf="/img/logFileIcon.png"
                              icon="/img/logFileIcon.png"&gt;
                              &lt;h:outputText value="#{item.name}" /&gt;
                          &lt;/rich:treeNode&gt;
                      &lt;/rich:tree&gt;
                  &lt;/h:form&gt;
              &lt;/rich:panel&gt;
  
              &lt;rich:panel styleClass="panelLogOutput" header="Log Content"&gt;
                  &lt;h:outputText escape="false"
                      value="Log content: #{MyBacking.nodeTitle}" id="selectedLog" /&gt;
              &lt;/rich:panel&gt;
          &lt;/h:panelGrid&gt;
      &lt;/rich:tab&gt;
  </code></pre>
  
  <p>Note the end <code>rich:tab</code> as this tree is rendering in a tab, from an included jsp file.  My backing bean method is also now:</p>
  
  <pre><code>    public void processLogSelection(NodeSelectedEvent event) {
      logger.info("In processLogSelection");
  }
  </code></pre>
  
  <p><strong>FURTHER EDIT</strong>
  Interestingly, I thought I'd rip back to a basic working model.  I took the code from the <a href="http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?tab=model&amp;cid=3835901" rel="nofollow noreferrer">RichFaces Demo Page</a>.  I modified the faces-config.xml to include the <code>SimpleTreeData</code> bean.  I had trouble getting the bean code which reads the data file in (<code>simple-tree-data.properties</code>) so I used a <code>FileReader</code> instead.  This built ok, and I got a modified index.jsp jsf page to list the simple tree example as on the demo page, except clicking on a list item didn't report the selected <code>nodeTitle</code> to the specified place (same problem).  </p>
  
  <p>I can see this either as the same problem reported above or the fact that the <code>loadTree</code> method in the <code>SimpleTreeData.java</code> bean has been changed.  In the change, I removed the following lines and changed extraneous code as appropriate:</p>
  
  <pre><code>        FacesContext facesContext = FacesContext.getCurrentInstance();
      ExternalContext externalContext = facesContext.getExternalContext();
      InputStream dataStream = externalContext.getResourceAsStream(DATA_PATH);
  </code></pre>
  
  <p>As mentioned earlier, I used a <code>FileReader</code> but does anyone think this problem could be related to me removing these 3 lines?  As also listed above, my <code>processLogSelection</code> method doesn't use <code>getCurrentInstance</code> but I'm not sure it needs to if <code>ajaxSubmitSelection="true"</code> is listed in the JSF.</p>
  
  <p>Stumped.</p>