integrating gwt-dnd?

I am currently evaluating Toolkit and would like to know if it is possible to integrate the gwt-dnd (drag and drop) library into it and, if yes, what would be the best way to do so?
Or if there is a better or easier way to get drag and drop functionality into Toolkit, please let me know aswell.

Thanks for any help.


Hi Niko,

it’s possible and actually quite straight-forward to integrate the gwt-dnd library into Toolkit.

I did this integration as a half-complete proof of concept some time ago, and even though I haven’t got around to finish it, the code was working and I could drag Toolkit components between Panels after just a couple nights of hackin’…

The implementation is a bit too long to write down here and now, but it all boils down to few (reasonably) simple steps…

First, you need to have drag controllers both at the server and the client side. Server side controller assigns unique ids to draggable components so that they can be mapped between server and client side counterparts.

Client side drag controller is created once for the widget set and hooks up with the root panel of the application (it has to be an AbsolutePanel to work). It handles all the dragging operations and calculations necessary to get things moving around the client side.

Draggable components and drop targets are mostly event listeners and dispatchers. At client side they move events back and forth between the client and the server, while at server side the components are busy thinking what to do with dragged stuff dropped at them.

I’m not entirely sure if this quick and rather untechincal intro was of any help to you, but to summize: a) yes, it can be done and b) it’s not that hard, really. All you have to write is the client-server communication of drag and drop events galore, and you have to take care of the mapping between server and client side components, but that’s about it.

Thank you very much for your response and the explanation. What you describe is roughly how I thought one would have to go about it. Good to know that you have already tried it. I’ll try to make it work, then.

Thank you!


Niko and Hannu. Please keep us updated about the progress of your DnD experiments/implementation. I am sure that many others are interested in this as well.

Does anybody of you maybe still have some code to look at? I’m trying to integrate some drag’n’drop support, but I’m currently not sure how to propagate the changes back to the server. Can anybody maybe give me some help?

Thanks a lot