Thank you for your reply. Before I read this, this is exactly what I did (stored HandlerRegistration and removed them when presenter was not being used).
However, I also did look at ResettableEventBus. BUT, it's recommended to only have one event bus per app (right?), and I don't want all handlers removed; just those associated with a particular presenter that the app decided is not being used. On 13 April 2011 20:48, ciosbel <[email protected]> wrote: > The signature of the method addHandler() that you use every time to add a > handler on the bus for a particular event, is: > > public abstract <H extends EventHandler > <http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/event/shared/EventHandler.html>> > HandlerRegistration > <http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/event/shared/HandlerRegistration.html> > *addHandler*(GwtEvent.Type > <http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/event/shared/GwtEvent.Type.html><H> > type, H handler) > > So it returns a HandlerRegistration that you can use to remove the added > handler. You have to keep track of all registered handlers and remove them > when you switch. > > With Activities, one of the parameters of the start() method is an instance > of a ResettableEventBus, so every time an activities is stopped (on place > change, display region change etc), all handlers attached to that eventbus > will be removed. This a really powerfull feature. And yes, you can use > ResettableEventBus without the new Activities & Places concept (but you need > at least gwt 2.1). > > Andrew. > > -- > 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. > -- 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.
