Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
master pages in vaadin
Hi, I would link to simulate what i normally do in html: a master page that is constant throughout the pages and a content that changes with each page. Ive thought about doing it by making a main window as the masterpage and a set of so called views - panels or layouts with the UI and then switch between them.
a couple of problems with this method:
first how do i switch between layouts or panels? do i remove the panel and then add the next panel?
Also, what if inside the panel itself there are links, how would that be done?
Im sure everyone goes through this when trying to do a web application in vaadin, so i just wanted to know the correct and best way of doing it, thanks
Yorgan Kalmin Zevlakov: Hi, I would link to simulate what i normally do in html: a master page that is constant throughout the pages and a content that changes with each page. Ive thought about doing it by making a main window as the masterpage and a set of so called views - panels or layouts with the UI and then switch between them.
This is exactly how it should be done.
Yorgan Kalmin Zevlakov: a couple of problems with this method:
first how do i switch between layouts or panels? do i remove the panel and then add the next panel?
You got it right again, remove the old view from the main layout and add the new view. Note that there is a replaceComponent method in layouts and panels for making this task a bit more easy.
Yorgan Kalmin Zevlakov: Also, what if inside the panel itself there are links, how would that be done?
Navigating between views can be a bit tricky, since you need references to the main layout and to the new and old views. I've created a small framework called Application Foundation and it contains a view module whose purpose is to make this navigation task much easier for the developer. Basically, you implement and register your views and after that you can activate any way from anywhere in the application - with just one line of code. You don't have to worry about passing view references around in the application. If you want to take a look at the framework, it can be downloaded from the directory. Make sure you also read the documentation for the view module.