I am using GWT. have below code in my host page.
<div id="mainDiv"/>
<iframe id="__printingFrame" style="width:0;height:0;border:0"> </iframe>
in EntryPoint's onModuleLoad() i have below code:
@Override
public void onModuleLoad() {
RootPanel.get("mainDiv").add(new SomePage());
}
in one of the methods of SomePage.java i am doing:
RootPanel rootPanel = RootPanel.get("__printingFrame");
rootPanel.add(new Html(" "));//adding some widget
But bcaz of above line i am getting below exception. Am i missing anything here?
java.lang.AssertionError: A widget that has an existing parent widget may not be added to the detach list
at com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java:136)
at com.google.gwt.user.client.ui.RootPanel.get(RootPanel.java:211)
Thanks!