danielm
2 Dec 2008, 8:16 AM
Hey,
i'm trying to put a ContentPanel to the RootPanel and after that i want to put addtional elements to the ContentPanel. But for some reason only elements that have been added to the ContentPanel, before it was added to RootPanel, are shown.
public void onModuleLoad() {
RootPanel root = RootPanel.get();
ContentPanel panel = new ContentPanel();
panel.setHeading("ParentPanel");
ContentPanel beforePanel = new ContentPanel();
beforePanel.setHeading("Panel added before parent is added to RootPanel");
panel.add(beforePanel);
root.add(panel);
ContentPanel afterPanel = new ContentPanel();
afterPanel.setHeading("Panel added after parent is added to RootPanl");
panel.add(afterPanel);
}
In this example only the beforePanel is shown. I'm trying this to put Elements to allready added Panels because i want to do that dynamical when a user clicks a button or something like this.
Would be nice if someone could give me a hint how to do this correctly.
i'm trying to put a ContentPanel to the RootPanel and after that i want to put addtional elements to the ContentPanel. But for some reason only elements that have been added to the ContentPanel, before it was added to RootPanel, are shown.
public void onModuleLoad() {
RootPanel root = RootPanel.get();
ContentPanel panel = new ContentPanel();
panel.setHeading("ParentPanel");
ContentPanel beforePanel = new ContentPanel();
beforePanel.setHeading("Panel added before parent is added to RootPanel");
panel.add(beforePanel);
root.add(panel);
ContentPanel afterPanel = new ContentPanel();
afterPanel.setHeading("Panel added after parent is added to RootPanl");
panel.add(afterPanel);
}
In this example only the beforePanel is shown. I'm trying this to put Elements to allready added Panels because i want to do that dynamical when a user clicks a button or something like this.
Would be nice if someone could give me a hint how to do this correctly.