• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

GWT drag&drop how to get widget source on drop event

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to implement an drag & drop in my project. I already managed, but now i want to distinguish the drag source.

I will have two widget from were i can drag lets call widget1 and widget2:

i made the handler for each one

now i had two absolute panels one only can receive from widget 1 and the other from widget 2

how can i manage to do that?

thanks for the help.
 
Greenhorn
Posts: 1
Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside OnDragStart use event.setData("text", uniqueDragId); where uniqueDragId is a unique drag Id in your application eg "1" or "draggable:1" etc

Then inside OnDrop test event.getData("text"); to determine if it is equal to "1" or whatever.

To get the actual text you are trying to "drop" you reference the object that you know uses the drag Id of "1" and get the text directly from it.

Therefore this whole approach doesn't really drag anything, it just uses the drag metaphor to give your "onDrop" code an id.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!