Does this work for you?

In this i have five button. I want to alert button number or i on click on of
that button.

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(e.getTarget().getUserData('st'));

           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;
   }

see the following example:
http://tinyurl.com/4p2ahrb

Tino


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<http://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



Am 19.01.2011 um 13:43 schrieb gouravmehta:


In this i have five button. I want to alert button number or i on click on of
that button.

Note: Button number can be any. Should be in loop only.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/problem-while-adding-button-Listener-in-loop-tp5939395p5939477.html
Sent from the qooxdoo mailing list archive at Nabble.com<http://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]<mailto:[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

Reply via email to