Correct way to sink events on UiBinder Element
I am defining several elements via UiBinder. My understanding is these are created as com.google.gwt.dom.client.Element during the createAndBind call.
@UiField
Element clickable;
DOM.sinkEvents((com.google.gwt.user.client.Element) clickable, Event.ONCLICK);
DOM.setEventListener((com.google.gwt.user.client.Element) clickable, new EventListener() {
public void onBrowserEvent(Event event) {
//TODO: Some code
-- I would like to add a click handler to one of these elements. Is there any way other than casting those to com.google.gwt.dom.client.Element like this?
@UiField
Element clickable;
DOM.sinkEvents((com.google.gwt.user.client.Element) clickable, Event.ONCLICK);
DOM.setEventListener((com.google.gwt.user.client.Element) clickable, new EventListener() {
public void onBrowserEvent(Event event) {
//TODO: Some code
}
});
});
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home