Hello all,
I created a horizontal navigation bar with different Tabs.
When I refresh the page while I am in the second tab, the page refreshes but the first navigation item/tab is highlighted instead of the second. The URL still displays the second page as it should, but the tab highlighting resets for some reason.
Can someone tell me what I do wrong?
final Tabs tabs = new Tabs();
tabs.setOrientation(Tabs.Orientation.HORIZONTAL);
tabs.setClassName("vaadin-tabs-top");
Tab t1 = createTab(VaadinIcon.FIRE, "FIRST NAV ITEM", FirstView.class); // first
Tab t2 = createTab(VaadinIcon.CHART_GRID, "SECOND NAV ITEM", SecondView.class); // second
final String contextPath = VaadinServlet.getCurrent().getServletContext().getContextPath();
Tab t3 = createTab(createLogoutLink(contextPath)); // logout
// add all buttons to the navbar
tabs.add(t1);
tabs.add(t2);
tabs.add(t3);
tabs.setSizeFull();
FlexLayout centeredLayout = new FlexLayout();
centeredLayout.setSizeFull();
centeredLayout.setJustifyContentMode(JustifyContentMode.CENTER);
centeredLayout.setAlignItems(Alignment.CENTER);
centeredLayout.add(tabs);
this.addToNavbar(true, tabs);