Reputation: 2385
Currently I have 2 navigators in my project. First navigator's ViewDisplay is UI and second navigators ViewDisplay is part of UI. I have created the second navigator for navigating through my side menu. As I want to change only the contents of selected menu items.
But the problem is I didn't find any way to tell vaadin when to use which navigator. Plus how vaadin manages multiple navigator? What is the lifecycle of navigators?
Any help will be appreciated. Thanks in advance.
Upvotes: 0
Views: 240
Reputation: 10643
Navigator
is tied to UI
and it is one to one relationship in Vaadin 7 and 8. So it is not possible to have multiple Navigator
s within one UI
. This limitation can be hacked of course by using multiple UI
's. So you need to implement the subview as its own UI
and embbed that to master UI
.
The best way to embbed the sub UI is to use BrowserFrame component or Embedded UI add-on which reduces need for boiler plate code. You can find more info from blog post Microservices and Vaadin UIs.
Vaadin was aware of this limitation, and in the new Vaadin 10+ platform series Navigator
has been replaced with Router
concept, that supports subnavigation.
Upvotes: 2