O'Reilly logo

Ext GWT 2.0 Beginner's Guide by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - dragging and dropping items

  1. In the RSSReaderConstants class, create a new constant named ITEM_DD_GROUP to act as an ID for the drag-and-drop group for items.
    public static final String ITEM_DD_GROUP = "itemDDGroup";
    
  2. At the end of the onRender method of the ItemGrid, but before the Grid is added, create a new GridDragSource using the Grid as the source component.
    GridDragSource source = new GridDragSource(grid);
    
  3. Set the group of the GridDragSource to ITEM_DD_GROUP.
    GridDragSource source = new GridDragSource(grid);
    source.setGroup(RSSReaderConstants.ITEM_DD_GROUP);
    
  4. In the constructor of the ItemPortlet class, create a DropTarget where the ItemPortlet is the target.
    DropTarget target = new DropTarget(this);
    
  5. Override the onDragDrop

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required