Receiving events from components inside other components

Hi all,

i have a panel, that contains another panel that contains some buttons:


i would like to manage buttons events at the first level ( panel 1 ). I’m not succeed with this.

I tried: Panel 1 —> implements Button.ClickListener but only receives panel 1 events, not cointained components events.

I’m sure i don’t understanding something. I suppose events propagates to superior levels by default but i think i’m not capturing correctly or may be i have to tell some component to propagate all events to the superior component.

Some idea?

Thanks in advanced!

Juan Manuel


No, events do not propagate like that at all. If you want to receive a particular components events, you need to attach a listener on that particular component instance.

(For instance in your case, your panels (on all levels) could publish the add/remove listener methods to upper levels, or they could attach the listeners directly and propagate the events up.)

Best Regards,

Thanks Marc!