How to remove handler of event bus?

472 views
Skip to first unread message

Bhumika Thaker

unread,
Jul 5, 2013, 6:10:40 AM7/5/13
to google-we...@googlegroups.com
Hi,


I am facing issue in  multiple initialize event bus handler.I want to remove handler of event bus some how once it's task completed. how can I remove event handler?

As I know if object is singleton instance, then this event bus handler is initialized only once and no problem in it.
But if multiple instance of object, then handler is initialized multiple then while I am firing event, it will call all initialized handler.

Just Example: I created Add comment dialog box. user enter some comment in it. and click on save button before saving comments to database, it will signing comment data using sign certificate popup , In that sign certificate popup, on save button click that will save some audit info into data then RPC return back and in success method. Now in success method I have to call Add Comment dialog box using event handler and do continue for other operation of it.

So here Add comment dialog box have multiple instances, it will initialize multiple handler. and event fired for before opened instances also. here I want to do like if once comment operation completed for dialog box,  then remove that action handler.

how can I remove event handler if my task for that panel's completed?

Thanks in Advance

Jens

unread,
Jul 5, 2013, 6:45:17 AM7/5/13
to google-we...@googlegroups.com
eventBus.addHandler() returns a HandlerRegistration instance that you can use to remove the handler from the EventBus.

If you are in a widget you should add an event handler to the EventBus in onLoad() and remove it in onUnload().

-- J.

Bhumika Thaker

unread,
Jul 5, 2013, 6:59:38 AM7/5/13
to google-we...@googlegroups.com, jens.ne...@gmail.com
Thank you so much. it works :)


--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/We1Ot8ERKVQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@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.
 
 

Reply all
Reply to author
Forward
0 new messages