Hello.
> I am defining several elements via UiBinder. My understanding is these are
> created as com.google.gwt.dom.client.Element during the createAndBind call.
Actually you can have elements of type SpanElement, Button, any class (I
think) you wish as long as you correctly reference them in the ui.xml file.
> 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?
You can use @the UiHandler annotation, like
public class MyFoo extends Composite {
@UiField Button button;
public MyFoo() {
initWidget(button);
}
@UiHandler("button")
void handleClick(ClickEvent e) {
Window.alert("Hello, AJAX");
}
}
as described on
http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html#Simple_binding
Hope this helps
Regards
Nicolas