0 Replies Latest reply on Feb 17, 2011 11:04 AM by butters

    rich:tree does not reRender after Drag and Drop operation

    butters

      Hello,

       

      i have implemented a document tree with the <rich:tree> and <rich:recursiveTreeAdaptor> components with drag and drop support. The root element of the tree is a Instance of a Entity class. The problem is that the tree does not reRender after the drag and drop operation. The dropListener is executed successfully, but the tree only reRenders if i expand or collapse a subtree. the rich:tree is nested in a <a4j:outputPanel>. I tried to change the reRender attribute to the tree itself and the outputPanel and added a reRender attribute to the <rich:dndParam> and <ich:treeNode> components, but nothing worked. Does anybody has a hint?

       

      Here is the code:

      <a4j:outputPanel id="treePanel" styleClass="editTree" layout="block">
           <a4j:form>    
                <rich:tree id="documenttree" style="width:600px" switchType="ajax"
                     dragIndicator=":treeDragIndicator" 
                     dropListener="#{documentHandler.processDrop}" reRender="documenttree" >
                     <rich:recursiveTreeNodesAdaptor id="treeAdapter"
                         roots="#{documentHandler.nodes}" 
                         var="item" 
                         nodes="#{item.children}">
                     <rich:treeNode icon="img/icons/iconFolder.gif" 
                         iconLeaf="img/icons/iconFolder.gif"
                         dragType="#{item.type.name}"
                         dragValue="#{item.id}"
                         dropValue="#{item.id}"
                         acceptedTypes="chapter, sect1, sect2">
                      <h:outputText value="#{item.title}"/>
                      <rich:dndParam name="label" type="drag" value="#{item.id}"/>
                  </rich:treeNode>
                 </rich:recursiveTreeNodesAdaptor>
                </rich:tree>
           </a4j:form>
       </a4j:outputPanel>

       

      an here ist the getter method that returns the root element of the tree: 

      public List<Element> getNodes() {
       List<Element> nodes = new ArrayList<Element>();
       nodes.add(this.document.getRoot());
       return nodes;
      }
      

       

      Best Regards,

      Jan