PDA

View Full Version : Multiple Instance of the same button



blessan
9 Aug 2010, 2:57 AM
I have a panel with card layout. There is a add button with common function in all the inner cards.
I set my button to a variable and gave the variable to each card bit only 1 instance will work. So I basically had to make 4 of the same buttons to get it to render in different card.
Why is it like this? Am i doing something wrong. I did not use a id in any of the elements.

evant
9 Aug 2010, 4:24 AM
You can't use the same component in multiple instances.

Instead, you should use some kind of factory function to return you an instance of the button.