Most likely the problem is with this inside the alert().
I'd suggest something like
...
subbut.addListener("execute",
function(e) {
alert(this.setUserData('st'));
},
this);
Cheers,
Fritz
On Wed, 19 Jan 2011, Tino Butz wrote:
Hi,
Could you please write a few sentences describing your problem?
Tino
Am 19.01.2011 um 13:13 schrieb gouravmehta:
getRootContextMenu : function()
{
var menu = new qx.ui.menu.Menu();
var sub = new qx.ui.menu.Menu();
for (var i=0; i<5; i++) {
var subbut = new qx.ui.menu.Button("Folder " + (i+1));
subbut.setUserData('st', i);
subbut.addListener("execute", function(e) {
alert(this.setUserData('st'));
});
sub.add(subbut);
}
menu.add(new qx.ui.menu.Button("move to", null, null, sub));
menu.add(new qx.ui.menu.Separator());
return menu;
}
Please suggest me any alternate.
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/problem-while-adding-button-Listener-in-loop-tp5939395p5939395.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Tino Butz
Mobile Architect
1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-4488
[email protected]
Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver
Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
--
Oetiker+Partner AG tel: +41 62 775 9903 (direct)
Fritz Zaucker +41 62 775 9900 (switch board)
Aarweg 15 +41 79 675 0630 (mobile)
CH-4600 Olten fax: +41 62 775 9905
Schweiz web: www.oetiker.ch
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel