Drag and Drop in GWT

· Google Web Toolkit

Regarding my previous rant, I am still waiting for GWT to be released on the Mac (with hosted mode, that is), and until that happens I am toying around with it in very slow pace. However, one issue is semi-resolved for me as I read this article from Nub Games. Apparently, there's an easy way to implement drag and drop in GWT, using mostly out-of-the-box tools provided by the framework and the rest is standard code that can be generified to an almost invisible level. I hope that soon some examples on my part would be available, but for now I can't use the Windows computer for GWT toying, and as for the Mac.. We'll have to wait for Google to make their move. Regarding that, Scott Blum of Google asked if anyone who's a Safari ninja (in code, not usage) could send him an email so that this situation could be fixed.

Comments (5)

Diwant
Hi, That Nub Games article is missing presently. Do you have another link? Thanks, Diwant
Diwant
Ok, so I Googled and a minute later found http://blogs.nubgames.com/code/?p=9 which I think is the same article's new url.
Avah
No.. And unfortunately, their site is not cached with Google either.. :-/ If I remember correctly, the idea was to capture mouseDown, and set a dragging flag to true. Then, on mouseMove, translate the position of the box (or movable object) to the mouse movement's deltas. Then, on mouseUp, set the flag to false. Simple, and could really be made generic for most objects.
Avah
Yeah I think that was it too. :)
Chaotic Java » Blog Archive » Drag and Drop in GWT - The How-To
[...] I wrote about GWT’s lack of drag and drop a long time ago, and since then have done many things instead of making a generic drag-drop mechanism as promised. Luckily, some other people have, and it seems like their solution is quite good and solves a wide array of drag-drop problems. [...]