View Full Version : I have a tab that doesn't remove when i call the Remove Function. What could be?

27 Apr 2011, 7:25 AM
Hi everybody!

I have a tabs bar that has some default tab, and then while you use the application another tabs are dinamically added to the bar, but, when i close some of this dinamically tabs, they dont remove at all. So, the last content that is show in those tabs never goes away, and new tabs always get the content from the las closed one.

All this new tabs has the closable flag true, and the problem happens only when i click on the X button of this tabs.

Weird enough, when I check wich methods are called, some times calle the beforeRemove and the Remove, and other times only the beforeRemove and never the remove method.

So, what could be? How can I overload the method or function in the X closable button?, to force the remove event in all cases.

Thanks in advance.

27 Apr 2011, 8:33 AM
Calling TabPanel.remove(targetTab) removes 'targetTab' from the TabPanel's child collection, but the targetTab is still a valid component and is still rendered in the DOM.

Try calling TabPanel.remove(targetTab, true) to force destruction of the tab being removed.

Also, if you don't want the targetTab destroyed (because you want to use it later), you must call targetTab.hide() after TabPanel.remove(targetTab).