Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Just can't get drag and drop to work
I've been experimenting with drag and drop for a few hours but I haven't even been able to get a component draggable. I'm starting to think I've missed something fundamental?
Anyway, I decided to try out an example I found, see attached file. The result I get from that project is basically a button who just refuse to be dragged, even less be dropped somewhere. Is there some configuration I have to do the project itself to enable drag and drop?
Strange, I don't see anything wrong with the code. I even imported the project and tried it, it works perfectly and I'm able to drag the Button around the AbsoluteLayout.
What browser are you using? Drag&Drop should work fine on all the supported browsers. Well, if the book example works for you, there shouldn't be a problem with the browser.
Yay! I figured it out.
The project contained a widgetset which was configured to only compile against gecko:
<set-property name="user.agent" value="gecko"/>
Once I commented that out and recompiled the set, it all started working. This seems weird to me because I was testing my app in Firefox 3.6 all along.
I don't know if this is the desired behavior or if it's a bug, I leave that up to someone more talented than I to decide :)
Thanks for your help which led to attack the problem from another angle.
This is odd. I tried with Firefox 3.5.9 and it worked fine. It may be that there's something changed with the user agent detection in GWT 2.
I found this comment:
user.agent=gecko is for gecko 1.7 (Firefox 1.0; this was used in GWTShell and
HostedMode in pre-2.0 GWT releases).
Use gecko1_8 to target gecko 1.8 and 1.9.x (Firefox 1.5 onwards).
Firefox 3.6 uses Gecko 1.9.2, while 3.5 uses 1.9.1, so there's no huge difference. In any case, try using "gecko1_8" and tell if it starts working. I added a ticket about the problem.
Yeah, you're right, switching to gecko1_8 worked as supposed to.