Hi,

there are several ways to solve your problem. But using "anonymous" is none of 
them.

The trivial way would be to access from container to panel and then to the 
child controls: e.g.
Container.panel.getChildControl("button").addListener("execute", function(){})

But I would never advise you to do like this. There are to much dependencies.

I would advise you to write a register function which registers all buttons 
generic. This register function can bundle all child control events to one 
event of the panel. e.g.

This code is not tested:
Code on control panel:
...
register : function(widget)
{
        Widget.addListener("execute", this.__onControlExecute, this);
}

__onControlExecute : function(e)
{
        /** This will fire a custome event "execute" provided with the original 
target (button) as data
        this.fireDataEvent("execute", e.getTarget());
}
...

By the way, "anonymous" property is to suspend all events of widget. This is 
helpful for labels and icons on button widget, but the button is worthless 
without any event ;)


Gruß
Mustafa Sak

Applications & Integration

1&1 Internet AG
Ernst-Frey-Straße 10
DE-76135 Karlsruhe

-----Ursprüngliche Nachricht-----
Von: dbrec [mailto:[email protected]] 
Gesendet: Montag, 19. August 2013 10:56
An: [email protected]
Betreff: [qooxdoo-devel] Event propagation to parent widget

I tried to find the solution on docs and on the forum without success.
So here's my question.
I have a custom widget that contains some basic qx widgets: merely a control 
panel with buttons inside.
The control panel is inside a container where I would like to listen for the 
execute events.
The child widgets of the control panel have been created with child control.

The question is: how can I propagete the "execute" events from the child to the 
parent widget in order to listen for it within the container?
I would avoid (if possible) to catch and re-launch the event.
I read that I should use the "setAnonymous" when creating child control, but is 
not clear to me how to listen for the child event.

THX, dbRec 





--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Event-propagation-to-parent-widget-tp7584389.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to