function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
IanM1963IanM1963 

Drag and Drop

Hi,

 

I seem to be struggling with finding a good starting point to getting  drag and drop functionality persisting back to the database in a Visualforce page.

 

I have a few questions regarding this based upon what I have found searching around for stuff.

 

  • Is drag and drop native to VisualForce yet? I saw a couple of posts hinting at the possibility.
  • If it is, then how do I go about implementing it? I can find plenty of PHP based examples but none in VisualForce.

My use case is that I want to be able to pull a list of start times and people from the database then allow the user to drag and drop a person from one start time to another and this then be saved back to the database upon dropping.

 

I have looked at so many different things now, as a newbie to SF I am getting very confused and I'm not sure  where to start. Do I need to use the Ajax Toolkit? I'd like to be able to use VisualForce directly but if not how about JQuery?

 

I really need some advice from you more experienced developers here as to the best way of cracking this.

 

Ian

 

 

bob_buzzardbob_buzzard

I don't believe that this is native to visualforce yet - there's plenty of it when configuring the system though.

 

There's no doubt plenty of ways to do this - I've used Dojo. The following was my starting point:

 

http://www.sitepen.com/blog/2008/06/10/dojo-drag-and-drop-1/

 

As I recall the trickiest bit was decorating the source and target components with the appropriate styling, but I was building a diary style system that allowed appointments of varying length to be dropped in, so had to determine free time before and after etc. 

 

In terms of sending the information back to VF, AFAIR I had some javascript that updated a hidden input field with the "new" information and then invoked an actionfunction to send it back to the controller.