open domain-tab on login

This commit is contained in:
Peter Hormanns 2016-09-21 16:47:14 +02:00
parent 2b24c2e9ff
commit 0a24cdb088
2 changed files with 6 additions and 4 deletions

View File

@ -38,6 +38,7 @@ public class EntryPoint extends CustomComponent {
tab.addComponent(selectTable); tab.addComponent(selectTable);
tab.setSizeFull(); tab.setSizeFull();
setCompositionRoot(tab); setCompositionRoot(tab);
setSizeFull();
} }
public void fillTable() { public void fillTable() {

View File

@ -42,13 +42,14 @@ public class EntryPointsSelector extends CustomComponent implements ItemClickLis
private void createTabs() throws RpcException { private void createTabs() throws RpcException {
final String role = getRole(); final String role = getRole();
final AbstractEntryPointsFactory entryPointsFactory = FactoryProducer.getEntryPointsFactory("default"); final AbstractEntryPointsFactory entryPointsFactory = FactoryProducer.getEntryPointsFactory("default");
boolean hasFirstTab = false; int tabCount = 0;
for(String tabName : entryPointsFactory.getEntryPointNames(role)) { for(String tabName : entryPointsFactory.getEntryPointNames(role)) {
accordion.addTab(new EntryPoint(this, tabName), I18N.getText(tabName)); accordion.addTab(new EntryPoint(this, tabName), I18N.getText(tabName));
hasFirstTab = true; tabCount++;
} }
if (hasFirstTab) { if (tabCount > 0) {
final Component component = accordion.getTab(0).getComponent(); accordion.setSelectedTab(tabCount - 1);
final Component component = accordion.getTab(tabCount - 1).getComponent();
if (component instanceof EntryPoint) { if (component instanceof EntryPoint) {
((EntryPoint) component).fillTable(); ((EntryPoint) component).fillTable();
} }