Hellu,

I upgraded to 1.6.4 and are trying to get rid of all the deprecated
stuff.
I first thought that the new Event handler was very nice... but then
noticed it's not always so friendly..

I just came across the use of the HandlerRegistration which I though
is quite handy... but not always like the older solution (simple
removeListeners(Listener) call):

1) Suppose you a WidgetGroup object that is used to categorize widgets
and this group wants to be informed when his contained widgets are
selected. As such the widgets that are added have to implement
HasClickListeners, such that the WidgetGroup instance can maintain one
click listeners that is added to every new added widget. When
removeWidget(widget) is called, this listeners is simple removed by
the call removeClickListener(ClickListeners).

This worked just fine...

But let's now try to use the new event model. We don't have the
removeClickListener() method anymore, but should use the
HandlerRegistration object that is returned by the method
addClickHandler()... This concerns the same listener that is added to
every received widget... So basically we add the same listeners to
many different widgets (handler managers) and get many different
HandlerRegistration back in return that we are suppose to use to
remove this listener, something that was done before with a simple
method call on the widget :(....
(you can think of similar examples, this is just one of them)


2) Suppose that you have a Composite widget with a addClickHandler()
method. You want to add the handler directly two the two wrapped
widgets: a select box and label. This is a bit unfriendly because you
have to create your own HandlerRegistration  object that wraps the two
that are returned by the addClickHandler() of the select box and
Label... But ok.... that's easy to solve...but still...


I am sure that the gwt team thought about these problems when desiging
this new event model.
So how are these problems solved best?

- Ed
--~--~---------~--~----~------------~-------~--~----~
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