On Feb 10, 6:57 pm, alfonz19 <[email protected]> wrote: > Hi, > this is shown as an example of binding event handler. > > public class MyFoo extends Composite { > @UiField Button button; > > public MyFoo() { > initWidget(button); > } > > @UiHandler("button") > void handleClick(ClickEvent e) { > Window.alert("Hello, AJAX"); > } > > } > > Right.So this is how ClickHandler implementation can be registered. > Ok, suppose I use TextBox instad of button. HOW will the framework > tell which EventHandler descendant to use? I can't figure it out. So? > How this thing work? It's NOT based on same type of method argument of > anotated (@UiHandler) method and method from handler interface, isn't > it?
Well, almost. In brief, ClickEvent "links" to ClickHandler (it extends DomEvent<ClickHandler>), so UiBinder makes a call to addClickHandler (yes, AFAICT, it just prepends an "add" in front of the handler's class name). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. 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.
