I’m trying to delete the whole content of an RootPanel element based on an ID. The RootPanel returns correct and I can see it’s content in the debugger. The problem is, that I delete it I tried the following things:
RootPanel rp = RootPanel.get("LayoutID2");
if (rp != null) {
for (Widget widget : rp) {
rp.remove(widget);
}
}
Any idea what I’m missing, or is there another function?
best regards,
Stefan
All of the contents of the
RootPanelmight not be widgets. For example if you placed following html in your host page:The text “Here goes the dynamic content” will not appear as a widget.
By the way, removal of all the widgets can be achieved by calling
rp.clear().