5 Replies Latest reply on Aug 21, 2008 5:04 AM by Paul Baker

    scrollableDataTable and DragSupport

    Paul Baker Apprentice

      After I sort a column on my scrollableDataTable the dragSupport fails.

      In IE I receive an error:

      ---------------------------
      Windows Internet Explorer
      ---------------------------
      Stop running this script?

      A script on this page is causing Internet Explorer to run slowly.
      If it continues to run, your computer may become
      unresponsive.


      ---------------------------
      Yes No
      ---------------------------



      Facelet for the scrollableDataTable:

      <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:rich="http://richfaces.ajax4jsf.org/rich"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:c="http://java.sun.com/jstl/core"
       xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
      
       <ui:include src="flightHdr.xhtml" />
      
       <rich:dragIndicator id="indicator" acceptClass="accept"
       rejectClass="reject">
       <f:facet name="single">
       <f:verbatim>
       {marker} <b>{testDrag}</b> {label}
       </f:verbatim>
       </f:facet>
       <rich:dndParam name="accept" value="Ok" />
       <rich:dndParam name="reject" value="Invalid Position" />
       </rich:dragIndicator>
      
       <h:form>
       <rich:dropSupport acceptedTypes="#{dragNdrop.flight.validPosTypes}"
       dropValue="table" dropListener="#{dragNdrop.processDrop}"
       reRender="deadload, positions">
       <rich:dndParam type="drop" name="accept">
       <h:outputText value="Move back to table"></h:outputText>
       </rich:dndParam>
       <a4j:actionparam value="table" name="DropValue" />
       <a4j:actionparam value="table" name="DropType" />
       </rich:dropSupport>
       <a4j:outputPanel>
       <rich:panel style="margin-left: 4px; background: #CAE1F8; border: 0px;">
       <rich:scrollableDataTable rowKeyVar="rkv" height="160px" width="724px" id="deadload"
       value="#{dragNdrop.flight.unallocatedDeadload}" var="next"
       sortMode="single" >
      
       <rich:column id="id" width="100px" style="text-align: center;">
       <f:facet name="header">
       <h:outputText value="Id" />
       </f:facet>
      
       <a4j:outputPanel>
       <rich:dragSupport dragIndicator=":indicator"
       dragType="#{next.uldType}">
       <a4j:actionparam value="#{next.id}" name="DragValue" />
       <a4j:actionparam value="deadload" name="DragType" />
       <rich:dndParam name="accept" type="drag">
       <h:outputText value="#{next.uldType}"></h:outputText>
       </rich:dndParam>
      
       <rich:dndParam name="reject" type="drag">
       <h:outputText value="#{next.uldType} not accepted"></h:outputText>
       </rich:dndParam>
       </rich:dragSupport>
       <h:outputText value="#{next.id}"></h:outputText>
       </a4j:outputPanel>
       </rich:column>
      
       <rich:column id="type" width="100px" style="text-align: center;">
       <f:facet name="header">
       <h:outputText value="Type" />
       </f:facet>
       <a4j:outputPanel>
       <rich:dragSupport dragIndicator=":indicator"
       dragType="#{next.uldType}">
       <a4j:actionparam value="#{next.id}" name="DragValue" />
       <a4j:actionparam value="deadload" name="DragType" />
       <rich:dndParam name="accept" type="drag">
       <h:outputText value="#{next.uldType}"></h:outputText>
       </rich:dndParam>
      
       <rich:dndParam name="reject" type="drag">
       <h:outputText value="#{next.uldType} not accepted"></h:outputText>
       </rich:dndParam>
       </rich:dragSupport>
       <h:outputText value="#{next.type}"></h:outputText>
       </a4j:outputPanel>
       </rich:column>
      
       <rich:column id="dest" width="100px" style="text-align: center;">
       <f:facet name="header">
       <h:outputText value="Dest" />
       </f:facet>
       <a4j:outputPanel>
       <rich:dragSupport dragIndicator=":indicator"
       dragType="#{next.uldType}">
       <a4j:actionparam value="#{next.id}" name="DragValue" />
       <a4j:actionparam value="deadload" name="DragType" />
       <rich:dndParam name="accept" type="drag">
       <h:outputText value="#{next.uldType}"></h:outputText>
       </rich:dndParam>
      
       <rich:dndParam name="reject" type="drag">
       <h:outputText value="#{next.uldType} not accepted"></h:outputText>
       </rich:dndParam>
       </rich:dragSupport>
       <h:outputText value="#{next.dest}"></h:outputText>
       </a4j:outputPanel>
       </rich:column>
      
       <rich:column id="weight" width="100px" style="text-align: center;">
       <f:facet name="header">
       <h:outputText value="Weight" />
       </f:facet>
       <a4j:outputPanel>
       <rich:dragSupport dragIndicator=":indicator"
       dragType="#{next.uldType}">
       <a4j:actionparam value="#{next.id}" name="DragValue" />
       <a4j:actionparam value="deadload" name="DragType" />
       <rich:dndParam name="accept" type="drag">
       <h:outputText value="#{next.uldType}"></h:outputText>
       </rich:dndParam>
      
       <rich:dndParam name="reject" type="drag">
       <h:outputText value="#{next.uldType} not accepted"></h:outputText>
       </rich:dndParam>
       </rich:dragSupport>
       <h:outputText value="#{next.weight}"></h:outputText>
       </a4j:outputPanel>
       </rich:column>
      
       <rich:column id="uldType" width="100px" style="text-align: center;">
       <f:facet name="header">
       <h:outputText value="ULD" />
       </f:facet>
       <a4j:outputPanel>
       <rich:dragSupport dragIndicator=":indicator"
       dragType="#{next.uldType}">
       <a4j:actionparam value="#{next.id}" name="DragValue" />
       <a4j:actionparam value="deadload" name="DragType" />
       <rich:dndParam name="accept" type="drag">
       <h:outputText value="#{next.uldType}"></h:outputText>
       </rich:dndParam>
      
       <rich:dndParam name="reject" type="drag">
       <h:outputText value="#{next.uldType} not accepted"></h:outputText>
       </rich:dndParam>
       </rich:dragSupport>
       <h:outputText value="#{next.uldType}"></h:outputText>
       </a4j:outputPanel>
       </rich:column>
      
       <rich:column id="remarks" width="200px">
       <f:facet name="header">
       <h:outputText value="Special Load" />
       </f:facet>
       <a4j:outputPanel>
       <rich:dragSupport dragIndicator=":indicator"
       dragType="#{next.uldType}">
       <a4j:actionparam value="#{next.id}" name="DragValue" />
       <a4j:actionparam value="deadload" name="DragType" />
       <rich:dndParam name="accept" type="drag">
       <h:outputText value="#{next.uldType}"></h:outputText>
       </rich:dndParam>
      
       <rich:dndParam name="reject" type="drag">
       <h:outputText value="#{next.uldType} not accepted"></h:outputText>
       </rich:dndParam>
       </rich:dragSupport>
       <h:outputText value="#{next.remarks}"></h:outputText>
       </a4j:outputPanel>
       </rich:column>
      
       </rich:scrollableDataTable>
       </rich:panel>
       </a4j:outputPanel>
       </h:form>
      </html>