I would like to have a situation where i can update components in the MainLayout that implements the RouterLayout class? For example:
public class MainLayoutSideMenu extends VerticalLayout implements RouterLayout {
private Label title;
private Div navBar;
MainLayoutSideMenu (){
title = new Label();
navBar = new Div(title);
add(navBar);
}
...
...
}
@Route(value = ERPDashboard.LINK, layout = MainLayoutSideMenu.class)
public class ERPDashboard extends VerticalLayout {
// In here is a way to access the MainLayoutSideMenu object to update the title say when i click a button
ERPDashboard(){
Button newButton = new Button("Update Title", e -> {
//Update title
});
}
}
Is there a way to access the MainLayoutSideMenu class object to update the title as in the example above?
Teddy L.