from one customLayout to another

my english is no very good, so i will try to do my best.

how can i from from one customLayout to another customLayout by clicking a button

login page → click by the user, then destroy de login page an create a new page.

thank you.

Hi Roberto,

I am not quite sure what you want to achieve.

Vaadin applications normally run in a single page. Take a look at this section of the
Book of Vaadin.
. Maybe this helps.

To switch from one Layout to another try something like this:

public class VaadinTests extends Application {

        public void init() {
                final Window mainWindow = new Window("VaadinTests");
                HorizontalLayout layoutOne = new HorizontalLayout();
                layoutOne.addComponent(new Label("layoutOne"));
                HorizontalLayout layoutTwo = new HorizontalLayout();
                layoutTwo.addComponent(new Label("layoutTwo"));
                Button bu = new Button("Change");
                bu.addListener(new Button.ClickListener() {
                        public void buttonClick(ClickEvent event) {

Haven’t tested the code myself. But it should be ok.


It’s usually easiest to replace the root layout of the window with getWindow().setContent(newContent).

The root layout is a VerticalLayout by default, although you can use any layout (or more exactly a component container).

Marko is absolutely right.

Because Roberto stated he is a beginner, I thought, according to his statement “from one layout to another layout + button” the (not so right) example helps him to understand it a bit better.