Thursday, February 28, 2013

How to detect when user DnD something into the app and the page unloads?

I'd like to disable DnD in my GWT app unless I specifically allow it (which I do in places).  Is there a way to detect and optionally prevent drops globally (prevent page unloads in this case)?

My use case is that we do support DnD in certain ways but if they drop wrong it causes the entire page to unload and then when they select the back browser button...the app will come back but they have to login again and reinitialize the app.

I thought of just adding a global Window.ClosingHandler() handler but that doesn't work because...there are lots of valid reasons the page is unloading and our security filters have already processed the that's too late...I think I need to detect that they did a drop, possibly by accident, and allow them to cancel the drop.


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment