4 Replies Latest reply on Oct 25, 2013 10:41 PM by dlee606

    Tree + expanded nodes + drag&drop = not working

    chupacabras

      I have Tree that is working.

      Collapsing and expanding is working fine as well. On server side I am able to detect and store which nodes are expanded and which collapsed.

      When I open page with Tree some nodes are defaultly expanded (I am using "expanded" attribute on node).

       

      Now I want to add Drag-and-drop support. Unfortunately I encountered a problem with that. Drag-and-drop is not working on defaultly expanded nodes. When I collapse such node and then expand, then drag-and-drop on child nodes is working.

       

      Richfaces 4.3.3.Final.

       

      Is that a bug in Richfaces or is there anything special I have to follow?

       

      xhtml:

      <rich:tree id="tree" nodeType="#{node.type}" var="node" value="#{structureBean.rootNodes}" toggleType="ajax" binding="#{structureBean.tree}"
        selectionType="ajax" selectionChangeListener="#{structureBean.selectionChanged}" toggleListener="#{structureBean.toggleListener}">
        
        <rich:treeNode type="department" iconLeaf="#{node.icon}" iconExpanded="#{node.icon}" iconCollapsed="#{node.icon}" expanded="#{node.expanded}">
      <a4j:outputPanel>
      <rich:dropTarget acceptedTypes="department, position" dropValue="#{node}" render="tree" dropListener="#{structureBean.processDrop}" />
      <h:outputLink value="../departments/department.xhtml?id=#{node.data.id}">
      <h:outputText value="#{node.data.universalTitle}" />
      </h:outputLink>
      </a4j:outputPanel>
      </rich:treeNode>
      <rich:treeNode type="position" icon="#{node.icon}" iconLeaf="#{node.icon}">
      <a4j:outputPanel>
      <rich:dragIndicator id="indicator" >test dnd</rich:dragIndicator>
      <rich:dragSource type="#{node.type}" dragValue="#{node}" dragIndicator="indicator" />
      <h:outputLink value="../positions/position.xhtml?id=#{node.data.id}">
      <h:outputText value="#{node.data.universalTitle}" />
      </h:outputLink>
      </a4j:outputPanel>
      </rich:treeNode>
        </rich:tree>