1


I was having ID collision of tab IDs when trying to recreate the same TabSet.
My case is the following : I have 3 Tabs in general, then some action creates a 4th one, some action happens in this 4th tab which is then closed, and I need to relaunch my app and redraw again the 3 general Tabs fetching new info from the database. Everything was working well, except this warning of collision which was not a blocking one anyway. In order to clean it, I followed Isomorphic's advice from this thread and tried destroying the TabSet in order to recreate it. I do:

if (myTabSet != null) {
    myTabSet.destroy();
}
myTabSet = new TabSet();
// setting TabSet properties
// creating Tabs and adding them to the TabSet

I noticed, however, in debug, that the TabSet is not being desroyed completely, just some of its properties, and that a new ID is being given to it. As a result, there are no more warnings, the tabs are created, but they're not populated.
My question is : why the TabSet is not becoming null upon destruction, and how can I recreate it with no collision of IDs?
Thanks in advance

4

1 回答 1

1

我曾经有同样的问题并修复它:

myTabSet.addCloseClickHandler(new CloseClickHandler() {

        @Override
        public void onCloseClick(TabCloseClickEvent event) {
            event.getTab().getPane().destroy(); 
        }
    });

显然,除非您破坏其窗格,否则选项卡集不会完全破坏。也许它会为你工作!

于 2013-06-24T16:20:39.470 回答