PDA

View Full Version : Reuse of a component



dbottillo
13 Sep 2010, 7:22 AM
Hi,

i want to reuse some components
if i have two panel, when application begin i add to first panel some object
after some user operations i want to remove this objects and put them on the second panel, like:



panelOne.add(firstItem);
panelOne.add(secondItem);
...
panelOne.remove(firstItem);
panelOne.remove(secondItem);
panelTwo.add(firstItem);
panelTwo.add(secondItem);


but i can't...i receive this error "Uncaught Error: INVALID_NODE_TYPE_ERR: DOM Range Exception 2"

even if i try:


panelOne.add(firstItem);
...
panelOne.remove(firstItem);
panelOne.add(firstItem);
i receive the same error..

i don't want to create double component, one for panelOne and one for panelTwo!!

is possible?

Daniele

jay@moduscreate.com
13 Sep 2010, 8:59 AM
You need to specify autoDestroy as false on your remove requests.

http://tdg-i.com/img/screencasts/2010-09-13_1257.png


...

http://tdg-i.com/img/screencasts/2010-09-13_1258.png


...

http://tdg-i.com/img/screencasts/2010-09-13_1259.png

dbottillo
14 Sep 2010, 7:02 AM
it works,
thank you very much