Friday, December 6, 2013

Re: What is the best practice for coding addChangeHandler in Gwt?

You have already answered your own question.

As you only need exactly on change handler registered, you can not put the handler registration code inside a method that is triggered by a button. Normally you add handlers either in the constructor of your widget or in the widgets onLoad() method (you need to override it).

As it seems like you use UiBinder then you normally just use @UiHandler, e.g.

@UiHandler
void onTestListBoxChanged(ChangeEvent event) {
  // do something
}

GWT will then generate the event registration code for you.

-- J.

--
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


Real Estate