I am making an HTML based GWT application. A layout has about 4 or 5 different layouts made using div and css. Right now, I have one HTML page that contains only the basic elements of my layout (header, body, footer). Other layouts are the same thing, with different layouts for the body (i.e., two columns, three columns). I tried to add additional markup to the base template using the following code:
RootPanel.get("main_area").add(html);
Where main_area is the identifier of my div body, and html is an HTML object with extra divs for the layout of the column.
This works fine, but when I try to add some text (or something else) to the divs, I added:
RootPanel.get("left_column").add(new Label("test"));
I get the following error:
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:122)
at com.google.gwt.user.client.ui.RootPanel.get(RootPanel.java:197)
, , , .