GWT 2.4.0 native drag and drop... does it *really* work with IE9?

938 views
Skip to first unread message

Rori Stumpf

unread,
Jan 24, 2012, 2:44:37 PM1/24/12
to Google Web Toolkit
Following the example from Google I/O 2011 (youtube video), I wrote
the following code which successfully implements drag and drop on
Chrome, Firefox and Safari.
But, of course, it does not work with IE9..

Here is the code... any obvious problems? What's up with GTW & native
drag and drop with IE9?

Thanks in advance... (p.s. I'd prefer to stick with native rather than
use a lib)

public void onModuleLoad() {

RootPanel.get("flow").add(dropLabel);
RootPanel.get("flow-components").add(dragLabel);

// Configure the draggable element
dragLabel.getElement().setDraggable(Element.DRAGGABLE_TRUE);
dragLabel.addDragStartHandler(new DragStartHandler() {
@Override
public void onDragStart(DragStartEvent event) {
event.setData("text", "drag-data");
event.getDataTransfer().setDragImage(dragLabel.getElement(), 0,
0);
} });

// Configure the drop target
dropLabel.addDragOverHandler(new DragOverHandler() {
@Override
public void onDragOver(DragOverEvent event) {
dropLabel.setText("Dragging Over");
} });
dropLabel.addDragLeaveHandler(new DragLeaveHandler() {
@Override
public void onDragLeave(DragLeaveEvent event) {
dropLabel.setText("Drop Here");
} });
dropLabel.addDropHandler(new DropHandler() {
@Override
public void onDrop(DropEvent event) {
Window.alert("Dropped!");
} });

}

rakesh wagh

unread,
Jan 24, 2012, 3:07:36 PM1/24/12
to Google Web Toolkit
we found that the drag and drop api is not usable at this point. There
is not a single browser in which this api work as expected. I think
the api is still in development and should not be used at this point,
unless you require part of it to work with specific browser.

Rori Stumpf

unread,
Jan 24, 2012, 3:29:21 PM1/24/12
to Google Web Toolkit

Ok. In the Google I/O talk they say that IE8+ is supported, so
something broke since then.

Thomas Broyer

unread,
Jan 25, 2012, 4:43:36 AM1/25/12
to google-we...@googlegroups.com
GWT disables DnD support for the ie6 and ie8 permutations (I don't why, as the HTML DnD API is modeled after the Microsoft API shipping in IE since IE5.5; see http://caniuse.com/dragndrop ), so first check the result of com.google.gwt.event.dom.client.DragDropEventBase.isSupported() in IE9.

Reply all
Reply to author
Forward
0 new messages