1 Reply Latest reply on Aug 26, 2008 12:40 PM by Roland Schöler

    rich:dataTable with Drag&Drop in every column triggers liste

    Roland Schöler Newbie

      Hello, first thanks for this great framework. It's very impressive, which great stuff is provided with this framework!

      Currently I try to implement full drag&drop support within one rich:dataTable with multiple rich:column. Every column is drag&dropzone. Haven't found nothing in the docs that this shouldn't be allowed - therefore I use it.....8-}
      BUT: This works only for drag and drop from left to right, but not from dnd from right to left.

      The problem is: if going from left to right - the normal order of listeners is triggered - first the dragListener and second the dropListener. But if I go from right to left - the first triggered listener ist the dropListener, and this throw a Nullpointer in my own code, because I assume that always the dragListener must be triggered first.
      And I use the dragListener to initialize some internal variables, and the dropListener to clean them....

      Here is my src from one column:

      <rich:column id="slot1_day0">
       <a4j:outputPanel id="out_slot1_day0" ajaxRendered="true" style="#{record.slot1[0].styleValue}" layout="block">
       <rich:dragSupport dragIndicator=":indicator" dragType="text" dragValue="#{record.slot1[0].oid}"
       dragListener="#{prod1Handler.addToDnDList}" >
       <rich:dndParam type="drag" name="label" value="#{record.slot1[0].order_number}" />
       </rich:dragSupport>
      
       <rich:dropSupport acceptedTypes="text" dropListener="#{prod1Handler.addSingleOrder}" />
       <h:outputText value="#{record.slot1[0].order_number}" />
       </a4j:outputPanel>
       </rich:column>
      


      The backing-bean prod1Handler has session-scope, if this is from relevance.

      Short snippet from the start of the table, because this table is inside a rich:tabPanel. Don't know if I really need the a4j:region, but it has no side-effects. Have tried with and without this element.
      <rich:tabPanel switchType="client">
       <rich:tab label="Produktion 1" id="tab_prod_1">
       <a4j:region selfRendered="true" id="region_prod_1">
      
       <rich:dataTable id="production1_detail"
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       cellpadding="0" cellspacing="0"
       width="100%" border="0" var="record" value="#{prod1Handler.resultModel}">
      


      dragIndicator is also used, and declared before the form-tag.
      <rich:dragIndicator id="indicator" />
      <h:form id="production_detail">
      


      My environment:
      Tomcat 6.0.16
      JDK 1.6.0_01
      MyFaces 1.2.3
      RichFace 3.2.2(Snapshot from 19.06.2008 richfaces-api-3.2.2-20080619.044039-17.jar etc.)

      Maybe someone can find the problemsource? Or is this a bug?

      with friendly greetings 8-}
      roland
      PS: Firebug doesn't show me any JS-Error....