How to unsubscribe handler from EventBus?

1,108 views
Skip to first unread message

Alex Luya

unread,
Apr 3, 2012, 11:46:30 PM4/3/12
to google-we...@googlegroups.com
Hello
I have two widgets,and both of them implement same event
handler,subscribe to same EventBus to listen same event.What I expect
is after view switching from widget1 to widget2,widget1 can be
unsubscribed from EventBus and collected by browser,so when event is
fired again,only widget2 will handle it.But actually,widget1 still live
and will handle the event.How can I solve this problem?

Thomas Broyer

unread,
Apr 4, 2012, 5:37:45 AM4/4/12
to google-we...@googlegroups.com
EventBus.addHandler returns a HandlerRegistration. Call removeHandler() on that object to remove the corresponding handler from the EventBus.

Santosh kumar

unread,
Apr 9, 2012, 2:28:26 AM4/9/12
to google-we...@googlegroups.com
Pass eventSource to the widget, and let the eventBus use this eventSource, after firing the event let the listener of the event source to process the event.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/rMOGWqM-NwgJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages