Hi,

Recently I have a problem and discover that the cause is about presenters
(activities non singletons) and views singleton. My code is similar to this:

private void bind() {
 myView.getButton1().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
...
});
 myView.getButton2().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
...
});
}

This method is invoque in start() method of the Activity.


BUT have a problem this code. Add multiple handlers (one each time an
activity start). Then, when I click the botton, the event execute n times (n
times execute start method in activity). So I think this bind() method is
dangerous, the presenter must know if the view is singleton or not.

There are a manner to use bind() method in activity and singletons view?

Juan

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

Reply via email to