Change Layouts Dynamically

Hi All,

These are my first steps on Vaadin and I’m having some issues when I need to update/replace a layout.

My app structure:

  • VerticalLayout (root)
    [list]
  • HorizontalLayout (header)
  • VerticalLayout (content)
    [list]

  • Table (List of Clients)


    [/list]
  • HorizontalLayout (footer)

    [/list]

For example, I want to click on a row of my client tables and replace the layout that contains the table in order to show another layout that contains the information of the client I’ve selected.

The result should be:

  • VerticalLayout (root)
    [list]
  • HorizontalLayout (header)
  • VerticalLayout (content)
    [list]

  • Layout/Panel with client information


    [/list]
  • HorizontalLayout (footer)

    [/list]

I’ve tried using replaceComponent(oldComponent, new component) without luck. I was able to set a new content to my main windows but I don’t want that approach because I want to keep my header and footer.

I will appreciate any help on this.

Thanks!
Ale

Could you post your code here?
replaceComponen() should work

When I was wrriten a small and concrete peace of code that shows the problem, I realizaed that issue was that I’m not setting the ratio of the new component/layout properly. Since I define the size in percentage, I need to set the expandRatio as well.

Thanks,
Ale