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.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.


Jane Dough
6 years ago Oct 19, 2016 8:55pm
Olli Tietäväinen
6 years ago Oct 21, 2016 1:30pm


just a thought, looking at the javadocs of the replaceComponent method: 

This method replaces component with another one is such way that the new component overtakes
the position of the old component. If the old component is not in the container, the new
component is added to the container. 

so maybe the rootComponent isn't the one you want? Could even be that the rootComponent is the same as the one returned by getLayout(), so you're basically writing oldLayout.replaceComponent(oldLayout, newLayout), which would just add the newLayout to the root layout of your userView.

I did a quick simple test with replaceComponent and it seems to work as advertised.