Hi all,
I am desperately trying to manage the layout of my UI.
Quite simple: it should contain a menubar of about 30-50 px in height, the rest of the area will be populated with a navigator to jump back and forth between views.
No matter what I try, I somehow always end up with the lower area overlapping my menu, or the navarea only contains the lower 50% of the browser space, working with an AbsoluteLayout does not even render both of my components. Can anyone help?
@Theme(“ccare”)
class MyUI extends UI {
Navigator navigator
private String loggedInUser
private MainView mainView
public MyUI() {
}
@Override
protected void init(VaadinRequest vaadinRequest) {
MenuBar menu = new MenuBar()
menu.setWidth("100%")
menu.setHeight("100px")
MenuBar.MenuItem customer = menu.addItem("Kundendaten", null, null)
MenuBar.MenuItem orders = menu.addItem("Auftragsdaten", null, null)
MenuBar.Command mycommand = new MenuBar.Command() {
public void menuSelected(MenuItem selectedItem) {
navigator.navigateTo(CustomerSearchView.NAME)
}
};
customer.addItem(CustomerSearchView.NAME, mycommand)
VerticalLayout content = new VerticalLayout();
VerticalLayout navArea = new VerticalLayout();
ComponentContainerViewDisplay vDisplay = new ComponentContainerViewDisplay(navArea)
content.addComponent(menu)
content.addComponent(navArea)
setContent(content)
navigator = new Navigator(this, vDisplay)
navigator.addView("", new MainView())
navigator.addView(CustomerSearchView.NAME, CustomerSearchView.class)
navigator.navigate();
}