1 2 Previous Next 26 Replies Latest reply on Apr 2, 2008 4:24 AM by Ilya Shaikovsky

    Drag-n-Drop broke in 3.1.4

    Paul Baker Apprentice

      I have drag-n-drop working in 3.1.2 but the same code fails using 3.1.4

      Message states drop zone with accepted types LD3 cannot accept type LD3. ????


      23:25:58,907 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=j_id333:j_id509[severity=(ERROR 2), summary=(Dropzone [j_id333:j_id509] with accepted types [[LD3, AKA]] cannot accept Draggable [j_id333:j_id538] with dragType [LD3]), detail=(Dropzone [j_id333:j_id509] with accepted types [[LD3, AKA]] cannot accept Draggable [j_id333:j_id538] with dragType [LD3])]


      <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.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">
      
       <h:form>
       <script type="text/javascript">
       function chgZindex(node, z) {
       document.getElementById(node.id).style.zIndex=z;
       }
      
       function chgColor(node, clr, wdt) {
       document.getElementById(node.id).style.borderColor=clr;
       document.getElementById(node.id).style.borderWidth=wdt;
       }
      
       </script>
      
       <h:panelGrid id="positions" border="0" columns="1"
       style="width:100%; overflow:auto; display:inline;">
       <rich:separator height="4" lineType="double" />
       <rich:spacer width="1" height="130" title="Here is a spacer..." />
      
      
       <c:forEach items="#{flight.positions}" var="pos">
      
       <rich:panel style="#{pos.style}" styleClass="#{pos.styleClass}"
       zindex="1" bodyClass="posBody"
       onmouseout="chgZindex(this, '1');chgColor(this,'Gray','2px');"
       onmousemove="chgZindex(this, '1000');chgColor(this,'Green','3px');">
       <rich:toolTip followMouse="true" direction="top-right" delay="1000"
       styleClass="tooltip" style="width:250px;">
       <span> This tool-tip will contain additional information
       about position: #{pos.position} and any load that has been
       assigned</span>
       </rich:toolTip>
       <rich:dragSupport dragIndicator=":indicator"
       dragType="#{pos.uldType}" dragValue="#{pos.position}"
       rendered="#{pos.assigned}">
       <rich:dndParam name="accept" type="drag">
       <h:outputText value="#{pos.uldType}"></h:outputText>
       </rich:dndParam>
      
       <rich:dndParam name="reject" type="drag">
       <h:outputText value="#{pos.uldType} not accepted"></h:outputText>
       </rich:dndParam>
      
       <a4j:actionparam value="#{pos.position}" name="DragValue" />
       <a4j:actionparam value="position" name="DragType" />
       </rich:dragSupport>
      
       <rich:dropSupport acceptedTypes="#{pos.validUldTypesArray}"
       dropValue="#{pos.position}"
       dropListener="#{dragNdrop.processDrop}"
       reRender="deadload, positions">
       <a4j:actionparam value="#{pos.position}" name="DropValue" />
       <a4j:actionparam value="position" name="DropType" />
       <rich:dndParam name="accept" type="drop">
       <h:outputText value="Assign position #{pos.position}"></h:outputText>
       </rich:dndParam>
      
       </rich:dropSupport>
       <h:commandLink actionListener="#{dragNdrop.unallocateAll}">
       <h:outputText value="#{pos.position}" styleClass="posText" />
       </h:commandLink>
       <h:outputText value="#{pos.posText}" styleClass="posText"
       escape="false"></h:outputText>
       </rich:panel>
      
       </c:forEach>
       <rich:separator height="4" lineType="double" />
       <h:panelGrid border="0" columns="2">
       <h:commandLink styleClass="commandlink"
       actionListener="#{dragNdrop.autoLoad}">
       <h:outputText value="Auto Load" />
       </h:commandLink>
       <h:commandLink styleClass="commandlink"
       actionListener="#{dragNdrop.unallocateAll}">
       <h:outputText value="Unallocate All" />
       </h:commandLink>
       </h:panelGrid>
       </h:panelGrid>
       </h:form>
      </html>
      
      


        • 1. Re: Drag-n-Drop broke in 3.1.4
          Paul Baker Apprentice

          No replies yet...

          Has anyone else had this problem? The only thing that I change is the Richfaces three jars. Works fine in 3.1.2 and does not work in 3.1.4

          The message that is output is suspicious:
          Message states drop zone with accepted types LD3 cannot accept type LD3. ????

          Quote:

          23:25:58,907 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
          sourceId=j_id333:j_id509[severity=(ERROR 2), summary=(Dropzone [j_id333:j_id509] with accepted types [[LD3, AKA]] cannot accept Draggable [j_id333:j_id538] with dragType [LD3]), detail=(Dropzone [j_id333:j_id509] with accepted types [[LD3, AKA]] cannot accept Draggable [j_id333:j_id538] with dragType [LD3])]


          Any ideas will be appreciated....


          • 2. Re: Drag-n-Drop broke in 3.1.4
            Florian Marwede Expert

            Yes I can confirm that. Drag & Drop is broken in 3.1.4 GA and latest 3.1.5 snapshot.

            Precisly spoken: The drop listener at the drop zone says that drag value and drag type are null. Exactly the same code is running well in 3.2.0 snapshots.

            • 3. Re: Drag-n-Drop broke in 3.1.4
              Paul Baker Apprentice

               

              Yes I can confirm that. Drag & Drop is broken in 3.1.4 GA and latest 3.1.5 snapshot.

              Precisly spoken: The drop listener at the drop zone says that drag value and drag type are null. Exactly the same code is running well in 3.2.0 snapshots.


              Thanks for that information!! I'll look forward to the fix.

              PB

              • 4. Re: Drag-n-Drop broke in 3.1.4
                Paul Baker Apprentice

                I just tried Drag-n_Drop with 3.2.0 Snapshot (03Mar2008) and problem is not fixed.

                sourceId=j_id333:j_id383[severity=(ERROR 2), summary=(Dropzone [j_id333:j_id383] with accepted types [[P1P]] cannot accept Draggable [j_id248:deadload:4:j_id279] with dragType [P1P]), detail=(Dropzone [j_id333:j_id383] with accepted types [[P1P]] cannot accept Draggable [j_id248:deadload:4:j_id279] with dragType [P1P])]
                14:04:50,132 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
                sourceId=j_id333:j_id419[severity=(ERROR 2), summary=(Dropzone [j_id333:j_id419] with accepted types [[AKF]] cannot accept Draggable [j_id248:deadload:4:j_id299] with dragType [AKF]), detail=(Dropzone [j_id333:j_id419] with accepted types [[AKF]] cannot accept Draggable [j_id248:deadload:4:j_id299] with dragType [AKF])]
                14:04:54,595 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
                sourceId=j_id333:j_id509[severity=(ERROR 2), summary=(Dropzone [j_id333:j_id509] with accepted types [[LD3, AKA]] cannot accept Draggable [j_id248:deadload:4:j_id299] with dragType [LD3]), detail=(Dropzone [j_id333:j_id509] with accepted types [[LD3, AKA]] cannot accept Draggable [j_id248:deadload:4:j_id299] with dragType [LD3])]


                Jars:
                commons-beanutils.jar
                commons-beanutils-bean-collections.jar
                commons-beanutils-core.jar
                commons-collections-3.2.jar
                commons-digester-1.8.jar
                jcommon-0.9.6.jar
                jfreechart-0.9.21.jar
                jsf-facelets.jar
                richfaces-api-3.2.0-SNAPSHOT.jar
                richfaces-impl-3.2.0-SNAPSHOT.jar
                richfaces-ui-3.2.0-SNAPSHOT.jar

                Comments?

                • 5. Re: Drag-n-Drop broke in 3.1.4
                  Michael Angelo Newbie

                  It has to be broke. I can't even get anything to drag from my source list. Has anyone even got that code to work?

                  I copied the code from the component showcase and that won't even work!!!!!!!

                  • 6. Re: Drag-n-Drop broke in 3.1.4
                    Florian Marwede Expert

                    Hmm...for me it works in 3.2.0 - only in 3.1.x it is broken. Please provide a minimal code snippet with a D&D operation doesn't work in all.

                    I'll try to make a code snippet too the next days.

                    • 7. Re: Drag-n-Drop broke in 3.1.4
                      Ilya Shaikovsky Master

                      But it's working under demosite (3.1.4 GA)..

                      Ok shoulkd be checked in latest vetsions...

                      • 8. Re: Drag-n-Drop broke in 3.1.4
                        Florian Marwede Expert

                        Ilya, one question: In the demo drag:support and drop:support are in the same form. Is this required? Is it possible to have them in different forms working together?

                        • 9. Re: Drag-n-Drop broke in 3.1.4
                          Paul Baker Apprentice

                          It is possible to initiate the drag in one form and drop into another form. That is the way that I have it working in 3.1.2. Works fine... I just wish I could get it working in version > 3.1.2.

                          • 10. Re: Drag-n-Drop broke in 3.1.4
                            Florian Marwede Expert

                            Great, this topic got its own issue: http://jira.jboss.org/jira/browse/RF-2457.

                            In the demo drag:support and drop:support are in the same form. Is this required? Is it possible to have them in different forms working together?


                            I ask because in my app this makes the difference between working and not working (in 3.1.4 GA and 3.1.5 latest).

                            Will provide a minimal code snippet soon.

                            • 11. Re: Drag-n-Drop broke in 3.1.4
                              Paul Baker Apprentice

                              Drag and Drop Still Broke using 3.2.0 Snapshot dated 15Mar2008.

                              Is there an open jira issue for this?

                              Mesage states that that drop zone with accepted type xxx cannot accepted type xxx.

                              sourceId=j_id344:j_id430[severity=(ERROR 2), summary=(Dropzone [j_id344:j_id430] with accepted types [[AKF]] cannot accept Draggable [j_id274:deadload:j_id293] with dragType [AKF]), detail=(Dropzone [j_id344:j_id430] with accepted types [[AKF]] cannot accept Draggable [j_id274:deadload:j_id293] with dragType [AKF])][/code


                              • 12. Re: Drag-n-Drop broke in 3.1.4
                                Florian Marwede Expert

                                Please provide a code snippet as minimal as possible which reproduce the problem.

                                I repeat: For me it is working in 3.2.0 without any restrictions and in 3.1.4 when both drag AND drop are in the same form.

                                • 13. Re: Drag-n-Drop broke in 3.1.4
                                  Paul Baker Apprentice

                                  In my case, drag and drop are NOT in the same form. This worked fine in 3.1.2 but is now broken. Providing minimal drag and drop code will be difficult. I am dragging from a data table (note that I would like to use scrollable table but that does not work either) to a rich:panel objects positioned using css absolute positioning.

                                  The table facelet: (I can drag one row at a time):

                                  <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.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:panelGrid border="0" columns="1"
                                   style="width:100%; overflow:auto; display:inline;" >
                                   <rich:panel styleClass="panelNM1" style="height: 230px; width=100%;">
                                   <center>
                                   <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>
                                   <rich:dataTable id="deadload" cellpadding="0" cellspacing="0"
                                   border="0" rows="5" var="next" width="80%"
                                   value="#{dragNdrop.flight.unallocatedDeadload}">
                                   <f:facet name="header">
                                   <rich:columnGroup>
                                   <h:column>
                                   <h:outputText value="Type" />
                                   </h:column>
                                   <h:column>
                                   <h:outputText value="Dest" />
                                   </h:column>
                                   <h:column>
                                   <h:outputText value="Weight" />
                                   </h:column>
                                   <h:column>
                                   <h:outputText value="ULD" />
                                   </h:column>
                                   <h:column>
                                   <h:outputText value="Serial Number" />
                                   </h:column>
                                   <h:column>
                                   <h:outputText value="Remarks" />
                                   </h:column>
                                   </rich:columnGroup>
                                   </f:facet>
                                  
                                  
                                   <h:column>
                                   <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>
                                   </h:column>
                                   <h:column>
                                   <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>
                                   </h:column>
                                   <h:column>
                                   <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>
                                   </h:column>
                                   <h:column>
                                   <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>
                                   </h:column>
                                   <h:column>
                                   <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.serialNum}"></h:outputText>
                                   </a4j:outputPanel>
                                   </h:column>
                                   <h:column>
                                   <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>
                                   </h:column>
                                   <f:facet name="footer">
                                   <rich:datascroller pageIndexVar="pageIndex" pagesVar="pages">
                                   <f:facet name="pages">
                                   <h:outputText value="#{pageIndex} / #{pages}"></h:outputText>
                                   </f:facet>
                                   </rich:datascroller>
                                   </f:facet>
                                   </rich:dataTable>
                                   </h:form>
                                   </center>
                                   </rich:panel>
                                   </h:panelGrid>
                                  
                                  </html>
                                  


                                  facelet: decklayout.xhtml

                                  I drag to/from rich panel objects that are positioned using absolute positioning:

                                  <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.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">
                                  
                                   <h:form>
                                   <script type="text/javascript">
                                   function chgZindex(node, z) {
                                   document.getElementById(node.id).style.zIndex=z;
                                   }
                                  
                                   function chgColor(node, clr, wdt) {
                                   document.getElementById(node.id).style.borderColor=clr;
                                   document.getElementById(node.id).style.borderWidth=wdt;
                                   }
                                  
                                   </script>
                                  
                                   <h:panelGrid id="positions" border="0" columns="1"
                                   style="width:100%; overflow:auto; display:inline;">
                                   <rich:separator height="4" lineType="double" />
                                   <rich:spacer width="1" height="130" title="Here is a spacer..." />
                                  
                                  
                                   <c:forEach items="#{flight.positions}" var="pos">
                                  
                                   <rich:panel style="#{pos.style}" styleClass="#{pos.styleClass}"
                                   zindex="1" bodyClass="posBody"
                                   onmouseout="chgZindex(this, '1');chgColor(this,'Gray','2px');"
                                   onmousemove="chgZindex(this, '1000');chgColor(this,'Green','3px');">
                                   <rich:toolTip followMouse="true" direction="top-right" delay="1000"
                                   styleClass="tooltip" style="width:250px;">
                                   <span> This tool-tip will contain additional information
                                   about position: #{pos.position} and any load that has been
                                   assigned</span>
                                   </rich:toolTip>
                                   <rich:dragSupport dragIndicator=":indicator"
                                   dragType="#{pos.uldType}" dragValue="#{pos.position}"
                                   rendered="#{pos.assigned}">
                                   <rich:dndParam name="accept" type="drag">
                                   <h:outputText value="#{pos.uldType}"></h:outputText>
                                   </rich:dndParam>
                                  
                                   <rich:dndParam name="reject" type="drag">
                                   <h:outputText value="#{pos.uldType} not accepted"></h:outputText>
                                   </rich:dndParam>
                                  
                                   <a4j:actionparam value="#{pos.position}" name="DragValue" />
                                   <a4j:actionparam value="position" name="DragType" />
                                   </rich:dragSupport>
                                  
                                   <rich:dropSupport acceptedTypes="#{pos.validUldTypesArray}"
                                   dropValue="#{pos.position}"
                                   dropListener="#{dragNdrop.processDrop}"
                                   reRender="deadload, positions">
                                   <a4j:actionparam value="#{pos.position}" name="DropValue" />
                                   <a4j:actionparam value="position" name="DropType" />
                                   <rich:dndParam name="accept" type="drop">
                                   <h:outputText value="Assign position #{pos.position}"></h:outputText>
                                   </rich:dndParam>
                                  
                                   </rich:dropSupport>
                                   <h:commandLink actionListener="#{dragNdrop.unallocateAll}">
                                   <h:outputText value="#{pos.position}" styleClass="posText" />
                                   </h:commandLink>
                                   <h:outputText value="#{pos.posText}" styleClass="posText"
                                   escape="false"></h:outputText>
                                   </rich:panel>
                                  
                                   </c:forEach>
                                   <rich:separator height="4" lineType="double" />
                                   <h:panelGrid border="0" columns="2">
                                   <h:commandLink styleClass="commandlink"
                                   actionListener="#{dragNdrop.autoLoad}">
                                   <h:outputText value="Auto Load" />
                                   </h:commandLink>
                                   <h:commandLink styleClass="commandlink"
                                   actionListener="#{dragNdrop.unallocateAll}">
                                   <h:outputText value="Unallocate All" />
                                   </h:commandLink>
                                   </h:panelGrid>
                                  
                                   </h:panelGrid>
                                  
                                   </h:form>
                                  
                                  
                                  </html>
                                  


                                  • 14. Re: Drag-n-Drop broke in 3.1.4
                                    Paul Baker Apprentice

                                    Problem still exists using: richfaces-ui-3.2.0-20080318.044912-100-bin.zip

                                    1 2 Previous Next