Hi,
I have problem with showing tabs in my Applayout, when i have only one Tab then my View isn`t showing if i have 2 Tabs and setSelectedTab for second tab then my view for both Tabs is showing correctly, i can select 1st Tab and view is showing. This is code where my tabs views are showing correctly:
Tabs tabs = new Tabs();
Tab mainTab = new Tab(div);
mainTab.setLabel("Main Tab")
Tab mainTab2 = new Tab(div);
mainTab2.setLabel("Main Tab2");
tabs.add(mainTab);
tabsToPages.put(mainTab, div);
tabs.add(mainTab2);
tabsToPages.put(mainTab2, div);
** tabs.setSelectedIndex(1);
**
tabs.addSelectedChangeListener(event -> {
final Tab selectedTab = event.getSelectedTab();
final Component component = tabsToPages.get(selectedTab);
tabs.setSelectedTab(selectedTab);
setContent(component);
});
And this code isnt showing my View for first tab but when i change to second tab then again to first the it work correctly(drawing my view)
Tabs tabs = new Tabs();
Tab mainTab = new Tab(div);
mainTab.setLabel("Main Tab")
Tab mainTab2 = new Tab(div);
mainTab2.setLabel("Main Tab2");
tabs.add(mainTab);
tabsToPages.put(mainTab, div);
tabs.add(mainTab2);
tabsToPages.put(mainTab2, div);
** tabs.setSelectedIndex(0);**
tabs.addSelectedChangeListener(event -> {
final Tab selectedTab = event.getSelectedTab();
final Component component = tabsToPages.get(selectedTab);
tabs.setSelectedTab(selectedTab);
setContent(component);
});