I ran into an issue recently with Dojo's ContentPanes. I was using them with
a TabContainer, and had made them closable; however, user actions might
re-open tabs that pull from the same source. This led to conflicts with
dijit IDs that I had to resolve.
Most Dijits have a destroyRecursive() method which should,
theoretically, destroy any dijits contained within them. However, for many
Dijits, this functionality simply does not work due to how they are
implemented; many do not actually have any knowledge of the dijits beneath
them.
ContentPanes fall into this latter category. fortunately, it's relatively
easy to accomplish, due to Dojo's heavily object oriented nature.