-1

I have a constant pane for a tab which is VLayout (lets say 'Layout-A'). Since it takes time to create this layout each time, i create only once. A Tab (lets say "Tab-A") displays this Vlayout. But it is closable. When tab is opened for the first time, it is ok. I can see Layout-A. But when i close and reopen this tab, i create Tab-A using 'new' and set its pane to Layout-A. Tab is empty.

Do i have to create my Layout-A each time when i open the Tab-A? Thanks...

gumgumok
  • 11
  • 3
  • Are you making new instances of Tab? – RAS Feb 18 '13 at 11:36
  • Thanks for your concern. I tried in both way. either i create new tab before adding it to tab set or keep same tab object to add when opened; result is same. I used updateTab for tabset or redraw for Layout-A, but nothing changed. – gumgumok Feb 18 '13 at 12:14
  • ok. on tab close, do you destroy that tab or just hide it? – RAS Feb 18 '13 at 12:35
  • i didn't find any method to hide a tab. I just remove Tab from TabSet using removeTab(Tab). – gumgumok Feb 18 '13 at 12:36
  • I think that is the problem. Try hiding the tab instead of removing it from tabset. – RAS Feb 18 '13 at 12:46
  • do you know, how can i hide a tab? There is no any method for Tab like hide() or setvisible(bool). It exists for TabSet but not for a specific Tab. – gumgumok Feb 18 '13 at 12:58

1 Answers1

0

I didn't find the source (just a comment), but I know that in the past I did some testing on that and I was playing with

theTabSet.updateTab(indexOfTheTabToRemove, null); You can look with the console and on the elements which are destroyed. Look at the javadoc of removeTabmethod.

So we have to set the pane to null, remove the tab which will not destroyed the pane you want to use and you will be able to reattribute to the tab when you want it.

There is one link talking about this case..... (look at the end of the post)

Alain BUFERNE
  • 2,016
  • 3
  • 26
  • 37
  • Thanks @Alain!. I tried updateTab using VLayout-A as new pane before, but i didn't tried setting previous pane to null. Now i use ***tabSet.updateTab(tabToRemove,null)*** and then ***removeTab(tabToRemove)***. When i reopen the tab and setting already created VLayout as pane, it displays correctly. Thanks... – gumgumok Feb 19 '13 at 08:32