--- In [email protected], "valdhor" <valdhorli...@...> wrote: > > By doing it with the click event on the child you are tight coupling the > child to the parent. > > By using the bubbling event you are loose coupling and free to use the > component anywhere. > > If you are comfortable with tight coupling, by all means use it. My own > preference is to use loose coupling and respond to events as and when I need > to. Sometimes it is useful to have multiple parent components in the chain > respond to an event at different levels. I stop the propagation once the > final component has handled the event.
I don't think what he has here is tightly coupled, per se, but the problem with it is that it has a high probability of errors (variable label not defined), since event.target in this case can very easily be a subcomponent of Button that might not have a label property (though I do believe if you click on the HBox itself you won't get this, since I _think_ Containers have a Label property for use with Accordions n such). HTH; Amy

