3 Replies Latest reply on Feb 25, 2009 9:54 AM by piyushk.singh

    Problem by drag and drop inner tree

      I try to drag and drop inner tree, use the capabilities of build-in drag and drop. But the drop can not be complete executed. With alert, i have found, that ondrop="alert('ondrop');" is ok, dropListener can call the java method too, but the ondropend="alert('dropend');" is not executed, as well as the oncomplete. Anybody can help me? Thanks in advance.

       <rich:treeNodesAdaptor nodes="#{category.children}" var="child" >
       <rich:treeNode icon="#{child.icon}" iconLeaf="#{child.icon}" title="#{child.portStatus}"
       dragType="#{category.label}" dragValue="#{child}"
       ondragend="twp = '#{category.label}'; setDraggedTypeFromPortTree();"
       acceptedTypes="#{child.acceptedTypes}"
       ondrop="alert('ondrop');startWait();"
       ondropend="alert('dropend');type = '#{child.portType}';"
       dropValue="#{child}"
       oncomplete="if (twp == 'IN')
       {
       if (type != 'ASI')
       {
       var tmp = getObjectElement(createMonitorFromTreeIpAddressId);
       if (tmp.onfocus != null)
       tmp.focus();
       }
       openTaskWizard();
       }
       else if(twp == 'fromTable')
       {
       Richfaces.showModalPanel('CreaterecordingTaskfromTree');
       }
       stopWait();"
       dropListener="#{ddTaskBean.processDropOnPort}"
      
       reRender="taskWizardContinuous, taskWizardEvent,taskWizardSingle,taskWizardMonitor,
       monitortaskOutData, CreaterecordingTaskfromTree, retrievalOutTypeId,taskWizardMonitor">
       <a4j:support event="onselected" reRender="settingsPaneWrapper,analyzerPaneWrapper"/>
      
       <rich:dndParam name="label" type="drag" value="#{child.label}"/>
       <h:outputText value="#{child.label}" />
      
       </rich:treeNode>
      


        • 1. Re: Problem by drag and drop inner tree

          I have tried with a simply example. I found that, the build-in drag and drop can not work as the same time. It means, by the situation, that a tree node can be dragged and accept the drop. the drag no problem, but the drop can only execute the ondrop, not ondropend and oncomplete. Is this a bug?

          
          <a4j:outputPanel id="treeWrapper" layout="block">
           <rich:tree id="portTreePaneId" style="width:200px"
           dropListener="#{appBean.addChildNode}" switchType="ajax"
           dragIndicator=":form:indicator" ajaxSubmitSelection="true">
           <rich:treeNodesAdaptor nodes="#{appBean.profileNodes}" var="profile" >
          
           <rich:treeNode acceptedTypes="pidDrag" dropValue="#{profile.label}"
           ondrop="alert('ondrop');"
           typeMapping="{pidDrag:pidDrag}"
           oncomplete="alert('complete');"
           dragType="pidDrag" ondropend="alert('ok');">
           <a4j:outputPanel layout="block">
           #{profile.label}
           </a4j:outputPanel>
           </rich:treeNode>
          
           <rich:treeNodesAdaptor nodes="#{profile.children}" var="pid" >
           <rich:treeNode dragType="pidDrag" dragValue="#{pid.label}">
           <rich:dndParam name="label" type="drag" value="dragged pid" />
           <a4j:outputPanel layout="block">
           #{pid.label}
           </a4j:outputPanel>
           </rich:treeNode>
           </rich:treeNodesAdaptor>
           </rich:treeNodesAdaptor>
           </rich:tree>
           </a4j:outputPanel>
          
          


          • 2. Re: Problem by drag and drop inner tree
            ilya_shaikovsky

            https://jira.jboss.org/jira/browse/RF-6029

            thanks for your submit! Please vote for the issues and feel free to comment

            • 3. Re: Problem by drag and drop inner tree

              Hi,

              Did you manage to get any workaround on the code which you have given. Please help me out as I am also stuck in a similar situation.

              Thanks
              Piyush