I have a TabPanel created in a View which I store in the Registry:
Code:
protectedvoid initUI() {
viewport = new Viewport();
viewport.setLayout(new CenterLayout());
ContentPanel panel = new ContentPanel();
panel.setBodyBorder(false);
panel.setHeaderVisible(false);
panel.setSize(600,600);
panel.setScrollMode(Scroll.AUTO);
tab = new TabPanel();
tab.setBodyBorder(false);
Registry.register("tabPanel", tab);
panel.add(tab);
viewport.add(panel);
RootPanel.get().add(viewport);
}
When I later on in another view loads the TabPanel and adds a tabItem I do like this:
Code:
TabPanel tab = (TabPanel) Registry.get(
"tabPanel");
searchTab = new TabItem(constants.searchTabCaption());
searchTab.setClosable(false);
searchTab.add(panel);
tab.add(searchTab);
When I then start my application none tab is selected so unless I click on the tab I don't the tab content and then it looks ok. But if I instead add the line
Code:
tab.setSelection(searchTab);
the tab is indeed selected but the layout does not look good, i.e. the table heading on a table in the tabitem together with two buttons does not look good.
What could be the problem?
/Markus