4 Replies Latest reply on Feb 21, 2008 6:18 PM by Scott Lepper

    Tree - Rerender selectedNode from commandLink

    Scott Lepper Newbie

      Is it possible to rerender the selectedNode of a tree from a commandLink?

      Code below. The commandLink adds a child item at the server side, but the node (already expanded) does not refresh. If I collapse then reexpand, it shows up.

      Is there a better or standard way to do this (add a child node to a node that is already expanded)?


      <a4j:commandLink actionListener="#{simpleTreeBean.addItem}" reRender="selectedNode">
      <h:outputText value="Add" />
      <rich:tree style="width:300px;" nodeSelectListener="#{simpleTreeBean.processSelection}"
      reRender="selectedNode" ajaxSubmitSelection="true" switchType="ajax"
      value="#{simpleTreeBean.treeNode}" var="item" changeExpandListener="#{simpleTreeBean.processExpand}"
      <rich:treeNode type="Taxonomy" iconLeaf="/images/taxonomy.gif" icon="/images/taxonomy.gif">
      <h:outputText value="#{item.data}" />
      <rich:treeNode type="Term" iconLeaf="/images/term1.gif" icon="/images/term1.gif">
      <h:outputText value="#{item.data}" />
      <rich:treeNode type="New" iconLeaf="/images/term1.gif" icon="/images/term1.gif">