You forgot to mention the GWT version. In GWT 2.0 you can use this piece of code or something similar. This function allows you to cancel events before they are transferred to the target widget.
Event.addNativePreviewHandler (new Event.NativePreviewHandler () {
public void onPreviewNativeEvent (NativePreviewEvent pEvent) {
final Element target = pEvent.getNativeEvent (). getEventTarget (). cast ();
// block all events targetted at the children of the composite.
if (DOM.isOrHasChild (getElement (), target)) {
pEvent.cancel ();
}
}
});
source share