Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT removeClickHandler

Tags:

gwt

GWT introduced with version 1.6 handlers to be used instead of listeners. Now I was used to add and remove those listeners to achieve certain behavior.

But as I move towards using handlers I miss the remove methods. Like removeClickHandler for the click event.

Is there a way to do this, or am I missing something?

like image 552
Drejc Avatar asked Oct 09 '09 13:10

Drejc


2 Answers

Each add...Handler method returns the HandlerRegistration interface. This interface contains the removeHandler() method. If you want to remove handlers, simple store the returned interface in a variable and call removeHandler when you want to remove the handler.

like image 50
Hilbrand Bouwkamp Avatar answered Sep 28 '22 04:09

Hilbrand Bouwkamp


I have found the solution

HandlerRegistration registration = addClickHandler(handler);

...

registration.removeHandler();
like image 36
Drejc Avatar answered Sep 28 '22 05:09

Drejc