2 Replies Latest reply on Oct 16, 2009 9:15 AM by L Kr

    drag'n'drop not working with rich:scrollableDataTable

    L Kr Newbie

      Hello,

      I'm working on (xhtml) site with a rich:scrollableDataTable on the left side and a rich:tree on the right side. The table have just one column. Now I would like to move an entry (row) from the table with drag'n'drop to the tree. Of course not such a big problem ;)

      But the problem is, it is not working anymore if I sort the table by a click on the header. Now I can't move the entries to the tree anymore. After reloading the whole page - and before sorting the table - it works again.

      I've tested it with all versions from 3.2.X to 3.3.X. Even in the newest 3.3.2.SR1 release is it not working. Of course I've cleared the browser cache AND also the tomcat cache every time.

      FF 3.5.3 (no plugins) and IE8 with Tomcat 6.0.18, WinXP SP3, Sun JSF 1.2 and Facelets

      Also I've removed all other JS libraries (like jQuery) and checked for JS errors.

      Here's my code:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a="http://www.conergy.com/jsf"
       xmlns:t="http://myfaces.apache.org/tomahawk"
       xmlns:ex="http://www.conergy.com/jsf/components"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j">
      
      <ui:composition template="/presentation/page_template.xhtml">
      ...
      <ui:define name="content">
      <a4j:region renderRegionOnly="true" id="userTreeWrapper">
      
      <rich:dragIndicator id="indicator" />
      <t:panelGrid columns="3" cellpadding="1" cellspacing="4" columnClasses="panelc,panelc,panelc" >
      
      <rich:scrollableDataTable
       rowKeyVar="rkv"
       width="200px"
       height="400px"
       id="allPlantList"
       columns="1"
       styleClass="plantdatatable"
       value="#{plantGroupAssocTreeController.allPlantList}"
       var="plant"
       sortMode="single">
       <rich:column id="displayString" width="200" >
       <f:facet name="header" >
       <h:outputText value="#{bundle['editplantgroups.plantList']}" />
       </f:facet>
       <a4j:outputPanel layout="block">
       <rich:dragSupport dragType="plant" dragValue="#{plant}" dragIndicator="indicator">
       <rich:dndParam name="label" type="drag" value="#{plant.displayString}" />
       </rich:dragSupport>
       <rich:dropSupport acceptedTypes="plant" dropListener="#{plantGroupAssocTreeController.processListDrop}" reRender="plantGroupTree,allPlantList"/>
       <h:outputText style="200px" value="#{plant.displayString}" />
       </a4j:outputPanel>
       </rich:column>
      </rich:scrollableDataTable>
      
       <t:div>
       <t:graphicImage url="/image/forall/px.gif" width="25" />
       </t:div>
      
      <t:panelGroup>
      <rich:tree
       id="plantGroupTree"
       dragIndicator="indicator"
       nodeFace="#{item.type}"
       style="width:300px"
       styleClass="plantdatatable"
       value="#{plantGroupAssocTreeController.tree}"
       var="item"
       switchType="client"
       treeNodeVar="treeNode"
       rowKeyVar="treeRowKey"
       dragType="plant"
       acceptedTypes="plant"
       ajaxSubmitSelection="true"
       reRender="selectedNodeValue,allPlantList,plantGroupTree"
       nodeSelectListener="#{plantGroupAssocTreeController.processTreeSelection}"
       dropListener="#{plantGroupAssocTreeController.processTreeDrop}">
       <rich:treeNode icon="#{item.plantImageUrl}" iconLeaf="#{item.plantImageUrl}">
       <t:outputText value="#{item.displayName}" />
       <rich:dndParam name="label" type="drag" value="#{item.displayName}" />
       </rich:treeNode>
       <rich:treeNode icon="#{item.plantImageUrl}" iconLeaf="#{item.plantImageUrl}" >
       <t:outputText value="#{item.displayName}" />
       <rich:dndParam name="label" type="drag" value="#{item.displayName}" />
       <t:graphicImage url="/image/forall/cross.png"/>
       </rich:treeNode>
      </rich:tree>
      ...
      
      


      Thank you, Lothar

      I've also found (at least) 2 new bugs in the current realease. But that's another story ;)