Hi, this is a problem that has bugged me for weeks if not longer.
I am able to work around it temporary, but i will encounter the same problem somewhere down the line. I have searched/googled and none of the solutions/suggestion helped. I would like to know fundamentally, what's wrong with the code.
The error recieved is as follows:
Uncaught JavaScript exception [uncaught exception: java.lang.AssertionError: A widget that has an existing parent widget may not be added to the detach list] in , line 0
Following is the code :
To reproduce the error, simply click on Tab2.
As mentioned, i have found workarounds like swapping tab1 and tab2 will work. But that's not what i'm interested. As i develop further, I will encounter this problem again.
Thanks in advance. Any inputs/insight to this issue is appreciated.
I am able to work around it temporary, but i will encounter the same problem somewhere down the line. I have searched/googled and none of the solutions/suggestion helped. I would like to know fundamentally, what's wrong with the code.
The error recieved is as follows:
Uncaught JavaScript exception [uncaught exception: java.lang.AssertionError: A widget that has an existing parent widget may not be added to the detach list] in , line 0
Following is the code :
Code:
public void onModuleLoad()
{
TabSet mMainTab = new TabSet();
Tab tab1 = new Tab("TAB1");
HLayout layout1 = new HLayout();
tab1.setPane(layout1);
Tab tab2 = new Tab("TAB2");
Canvas debugCanvas = new Canvas();
final ScrollPanel mMainContent = new ScrollPanel();
debugCanvas.addChild(mMainContent);
tab2.setPane(debugCanvas);
mMainTab.addTab(tab1);
mMainTab.addTab(tab2);
mMainTab.setWidth100();
mMainTab.setHeight100();
RootPanel.get().add(mMainTab);
}
As mentioned, i have found workarounds like swapping tab1 and tab2 will work. But that's not what i'm interested. As i develop further, I will encounter this problem again.
Thanks in advance. Any inputs/insight to this issue is appreciated.
Comment