Can't add listener for child control

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can't add listener for child control

Port

Hi, all. I'd like to separate 'tap' events for qx.ui.basic.Atom.

I have a control:

control = new qx.ui.basic.Atom();

get his label child control and add listener:

control.getChildControl("label").addListener("tap", function() {
       console.log('test');
}, this);

And console.log('test') doesn't work when I tap Atom. Please help. Thanks a lot.


------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't add listener for child control

lqip32
The label in the atom widget is anonymous. If you really want to listen actions on the label you should set anonymous to false.
control.getChildControl("label").setAnonymous(false);

see example here
http://tinyurl.com/nurvm4x

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't add listener for child control

Cajus Pollmeier
In reply to this post by Port
Thats most likely because the "label" child control has set "anonymous"
to true. So it will not react on these events. Although this is a bit
of "misuse" of the Atom, you can set it to "true" and it should work:

http://tinyurl.com/oalnfwc

Am Mittwoch, den 21.10.2015, 16:35 +0300 schrieb Олег Портнихин:

> Hi, all. I'd like to separate 'tap' events for qx.ui.basic.Atom.
>
> I have a control:
>
> control = new qx.ui.basic.Atom();
> get his label child control and add listener:
>
> control.getChildControl("label").addListener("tap", function() {
>        console.log('test');
> }, this);
> And console.log('test') doesn't work when I tap Atom. Please help.
> Thanks a lot.
>
> ---------------------------------------------------------------------
> ---------
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

signature.asc (180 bytes) Download Attachment
Loading...