-
1. Re: page error trying basic Drag-n-Drop
jgreene Jun 27, 2007 11:48 AM (in response to jgreene)I've figured out how to do the basic drag. I haven't used many of the attributes, but at least I'm dragging an image.
When I add dropSupport, do I actually have to have an action method on the back end, or should I just be able to drop the dragged item somewhere on the page, as long as the area that I drag it to is coded properly?
- JG -
2. Re: page error trying basic Drag-n-Drop
sergeysmirnov Jun 27, 2007 12:18 PM (in response to jgreene)a4j:dropSupport has dropListener where information about dropped object is available. In addition, you can fill the f:param or a4j:actionParam that will be also available on the server side.
There is no any predefined behavior on the client or server sides. I.e. you need to provide your own logic what happen on the server side and what is changed on the client side when drop occurs.
See http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dropSupport -
3. Re: page error trying basic Drag-n-Drop
jgreene Jun 27, 2007 6:10 PM (in response to jgreene)Thanks, Sergey. But I've tried to look at this demo before, and although it is useful, it has no server side code to look at. Besides, this example looks like it probably uses lists, which is a little easier to figure out how to work with on the server. But I'm trying to drag an image icon onto a larger image and make it stick. Although it may be easy, its not obvious to me how to make it work. At least it would be good to see the server side code in your example.
-
4. Re: page error trying basic Drag-n-Drop
sergeysmirnov Jun 27, 2007 6:23 PM (in response to jgreene)"jgreene" wrote:
.... it has no server side code to look at.....
The link to the source code of richfaces-demo is always available in the "RichFaces Most Important Links" post. (See in my signature below). -
5. Re: page error trying basic Drag-n-Drop
jgreene Jun 28, 2007 9:46 AM (in response to jgreene)Thanks, Sergey.
-
6. Re: page error trying basic Drag-n-Drop
adam_p_wells Aug 13, 2007 2:15 AM (in response to jgreene)"jgreene" wrote:
I've figured out how to do the basic drag. I haven't used many of the attributes, but at least I'm dragging an image.
I am still stuck with this error - could you please give some hints about how you did the basic drag?
I'm using:
JBoss 4.2.1.GA
RichFaces 3.0.2
Seam 2.0.0 Beta<rich:dragIndicator id="indicator"></rich:dragIndicator> <h:form id="form"> <h:panelGrid columns="2" width="100%" > <rich:panel style="width:100px"> <f:facet name="header"> <h:outputText value="Available Roles" /> </f:facet> <h:dataTable id="src" columns="1" value="#{roleList.resultList}" var="role" > <h:column> <a4j:outputPanel style="border:1px solid gray;padding:2px;" layout="block"> <rich:dragSupport dragIndicator=":indicator" dragType="text" dragValue="#{role}" > <rich:dndParam name="label" value="#{role}" /> </rich:dragSupport> <h:outputText value="#{role.name}"></h:outputText> </a4j:outputPanel> </h:column> </h:dataTable> </rich:panel> <rich:panel> <f:facet name="header"> <h:outputText value="Assigned Roles" /> </f:facet> <rich:dropSupport id="assigenedRolesDrop" acceptedTypes="text" dropValue="role.name" reRender="assignedRoles, src"/> <h:dataTable id="assignedRoles" columns="1" value="#{contact.roles}" var="role"> <h:column> <h:outputText value="#{role.name}"></h:outputText> </h:column> </h:dataTable> </rich:panel> </h:panelGrid> </h:form> </rich:tab>