Try that

var clazz=this;
label[key].addListener("click", function(e) {
                        clazz.zeitmodus = this.getUserData("key");
 });

Von meinem iPhone gesendet

Am 29.12.2010 um 23:32 schrieb "[email protected]" <[email protected]>:

> i try to add some lables in an for each
> 
> like this
> 
>                 // Selektor                
>                 var layout = new qx.ui.layout.HBox();
>                 var selectorbar = new qx.ui.container.Composite(layout).set({
>                      decorator        : null,
>                     allowStretchX     : true,
>                     allowStretchY     : true,
>                     });
> 
>                 var zeiten = this.loadZeittypen();
>                 var label = [];
>                 for(var key in zeiten){
>                     label[key] = new       
> qx.ui.basic.Label(zeiten[key]["title"]);
>                     label[key].setPadding(4);
>                     label[key].setAllowStretchX(true);
>                     label[key].setCursor("pointer");
>                     label[key].setBackgroundColor(zeiten[key]["bgcolor"]);
>                     label[key].setUserData("key",key);
>                     label[key].setDecorator("main");
>                     label[key].addListener("click", function(e) {
>                         this.zeitmodus = label[key].getUserData("key");
>                         },this);
>                     
>                     selectorbar.add(label[key],{flex:1});                     
>     
>                     }
> 
>  but this always get the last  label added on every event. how can i  get the 
> right  label object  on every added event?
> 
> 
>                 
>                   container.add(selectorbar, {edge:"north"});
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and, 
> should the need arise, upgrade to a full multi-node Oracle RAC database 
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to