Hi @ All,

I have a strange Problem. My App creates some buttons out of a database.
I get a table with all button-information out of a Msql Database via RPC and 
PHP Backend.
Further I store the information in some Datastructure.
So far it is not a problem at all.

No I want to add all the buttons to the desktop. To do so, I implemented a 
"for" loop.

for (var i=0; i < array.getLength(); i++)
{
                        var button_new = new qx.ui.form.Button(label, icon);
                
                        button_new.addListener("dblclick", function(e) {
                        //Do something if button 1
                        //Do something else if button 2
                        //Do something else if button 3.....
                        },this);
                                                
                        desktop.add(button_new , left: 50+(10*i), top: 
50+(10*i)});
                        
} 

This code above is just a sample code and does not include all detailed code, 
needed to run this.
Also this "left: 50+(10*i), top: 50+(10*i)" is just pseudo code, because 
normally I get the position out of the Datastructure.

But in general I get my buttons on the screen, with the right position. 
Everything is fine!

But the big issue is now, that I want to click them. This is the Problem! If I 
click a button, I always get the action from the last added Listener!!

So in general every button proceeds the Listener action defined for the last 
button! Why? I want to have as many listeners as buttons!

I already implemented something like this a week before, in some other cas, an 
it works,.. I´m pretty confused why this doesn´t work.

Help!

Thank you!
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to