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>