1 Reply Latest reply on Jan 7, 2008 6:56 AM by cheng bin

    problem in recursiveTreeNodeAdaptor

    cheng bin Newbie

      i want to build an tree with richfaces through the "recursiveTreeNodeAdaptor". And i added the DragAndDrop in it to realize the function of dragging any elements and dropping them anywhere in the same tree. problem: when i drag one elements and drop it in another,the elements can't be removed in the pre-directory.sometimes a NullPointerException will occur with 'drogValue'. here is my jsp

      <rich:tree id="tree" style="width:150px" switchType="ajax">
       <rich:recursiveTreeNodesAdaptor id="treenodeadaptor"
       roots="#{treeBean.points}"
       var="item"
       nodes="#{item.points}"
       includedNode="#{item.render=='real'}">
       <rich:treeNode id="treenode"
       ajaxSingle="true"
       dragIndicator=":indicator"
       acceptedTypes="#{item.type}"
       dragType="dir"
       dragListener="#{treeBean.dragProcess}"
       dropListener="#{treeBean.dropProcess}"
       reRender="tree"
       dragValue="#{item}"
       dropValue="#{item.id}">
       <a4j:commandLink value="#{item.name}" actionListener="#{treeBean.clickProcess}">
       <f:param value="#{item.name}" name="name"></f:param>
       </a4j:commandLink>
      
       </rich:treeNode>
       </rich:recursiveTreeNodesAdaptor>
      </rich:tree>
      

      i build my 'static' tree recursively in a class. If one elements is draged to a dir,its parentID will change,and reBuild the tree