The handler registration is, as far as I know, just a way to register
a new handler to a composite.

The exact detection happens when the clickhandler is added to the
composite:
                HandlerRegistration reference = 
yourCompositewidget.addClickHandler
(new ClickHandler(){

                        public void onClick(ClickEvent event) {
                                yourCompositewidget.dosomething();
                        }

                });

The disabling (removing of the handler) would happen with
     reference.removeHandler();

That's the simplest way to do this I think.


On 22 jun, 16:34, romant <[email protected]> wrote:
> Hi guys,
> I have my own Button class which extends Composite. I use grid which
> creates the basement of the button component. You can of course detect
> click events on the grid/button by calling
>
>     public HandlerRegistration addClickHandler(ClickHandler handler) {
>         return addDomHandler(handler, ClickEvent.getType());
>     }
>
> That's probably not the best approach considering the fact that now i
> need the possibility to implement "disable" function which should
> disable the click events. What is generally the best approach to
> achieve that? Should I store all the registered click handlers in a
> list and unregister them, then after enabling the button register them
> again?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
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