>> I'm not sure why do you remove the object? We use similar methodology, in page Activate method we add a container if it's not there using NEWOBJECT method. But once added, this container remains added.
>
>Hi Naomi,
>
>The container class that I am adding changes, depending on a value that can be set when initializing a form OR selected from a combobox on screen. I remove the object before adding it again to clear the original object. I could add code to only remove and add the container if the class HAS changed - it would probably be more efficient that way.
And if it has changed back to something you had two minutes ago, you'll still have to kill the current object and create the old one from scratch, and caching is your friend...
Even more efficient would be to have a collection of such objects and keep only the relevant one visible. So instantiate on demand, add to collection. Next request, hide current object, check the collection, if found show it, if not add it.
On destroy, just .remove(-1) on the collection, then remove the collection.