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

    Tree - Rerender selectedNode from commandLink

    leptronic

      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)?

      Thanks.

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