For receiving events on DOM elements, check out the DOM class.
DOM.sinkEvents(element, Event.ONCLICK);
and for multiple events:
DOM.sinkEvents(element, Event.ONCLICK | Event.ONFOCUS | .... | ....)
and finally:
DOM.setEventListener(element, new EventListener() {...implement...});
Make sure to clean up the EventListener if the element is removed from the
DOM using DOM.setEventListener(element, null). Otherwise you may risk a
memory leak.
You also need to hard cast your DivElement into
com.google.gwt.user.client.Element to make it useable with the DOM event
methods above.
-- J.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/VYO-g4kHKngJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.