Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to customize DND behavior between Grid and Window?

    Hi,

    I am trying to implement DND between records in a Grid and a Window that contains a GWT Maps MapWidget. The records in the Grid contain geopositions that should be rendered on the map as markers.
    The Grid is bound to a datasource and contains the following lines to enable DND of records:
    Code:
    geoGrid.setCanDragRecordsOut(true);  
    geoGrid.setDragDataAction(DragDataAction.COPY);
    The map window (which holds the MapWidget) contains the following code to enable dropping:
    Code:
    mapWindow.setCanAcceptDrop(true);  
    mapWindow.addDropHandler(new DropHandler() {
    	@Override
    	public void onDrop(DropEvent event) {
    		GWT.log("onDrop called.");
    	}
    When records are dropped on the mapWindow the onDrop() is invoked as it should but additionally, *all* records (not just the selected) of the Grid are *moved* to the mapWindow displacing the mapWidget.
    So there is probably another method causing this which has to be overridden to prevent this behavior.
    This thread http://forums.smartclient.com/showthread.php?t=8381&highlight=drop+implement discusses overriding the drop() method of the drop target. Unfortunately, it's for smartClient and the smartGWT Widgets are lacking the drop() hook. What is the recommended approach for smartGWT?

    Thanks
    fatzopilot

    #2
    Finally,

    Code:
     event.cancel();
    solved all issues :)

    Comment


      #3
      Thanks for posting this solution, it saved me a lot of wasted time!

      Comment


        #4
        ive been searching for this for days, literarily.

        huge thank you :)

        Comment

        Working...
        X