Application structure with MenuBar and Navigation

Hi,
I found that it is so very difficult to build a classic webapp with vaadin. Just a Menubar with a navigation under the Menubar is impossible, at least for me at my stage. I generated a Menubar, add the command, Navigator and the result is that a selection of a menuitem changes my whole page instead of only the “workarea”. According to the menuitems I generated different View-Classes like View1 and View2. Within the view1 class I have my ui-controls (without the menu) which is necessary for this topic. My thought was that I show in a startview the menu with a panel at the bottom. I expect that I can set the panel content according to my menu selection. BUT: I cant. the navigate.to(…) just change my whole page.
I tried something like new Navigator(Panel) but it doesnt allow me.
I just need a application structure with a menubar and a working area, is it possible in Vaadin 7 ???

Thx

Hi,


This example
shows how to implement basic menu navigation with MenuBar and Navigator.

If you want to have a separate start view without the MenuBar, it’s a bit different. The
basic Navigator example
shows how to do that, although with a different menu solution than the MenuBar.

Thx for pointing me to this example. But allow me a short question. This example use the menu.addView(…) method. On this way it is not possible to use Submenus, right?

To get sub-menus, you would need to add the menu items rather differently from what is done in the addView() method. The method just adds a menu item and maps the view name to it.

Note that the example highlights the selected menu item, but it’s only meaningful for the top-level menu items, so if you have a hierarchical menu, you need to handle that differently.