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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
more than one layout in one page
Hello,
I have created a page based on the panel from vaadin demo, but with more than one layouts to show/hide some components for different situation, how can i set every component aligned correctly? in the small and large panel?
Thanks.
public class EditUserForm extends VerticalLayout
{
private FormLayout userNameLayout = new FormLayout();
private FormLayout passwordLayout = new FormLayout();
private FormLayout criteriaLayout = new FormLayout();
userNameLayout.addComponents(username, displayName);
passwordLayout.addComponents(password1, password2);
// newUserPanel.setContent(newUserLayout);
userNameLayout.setSizeUndefined();
passwordLayout.setSizeUndefined();
addComponent(userNameLayout);
addComponent(passwordLayout);
}
void create()
{
passwordLayout.setVisible(true);
criteriaLayout.setVisible(false);
username.setReadOnly(false);
setVisible(true);
}
Last updated on
Hi!
No built-in way for this, I'm afraid. You can either use one layout (e.g. with separate fieldgroups) or you need to set some fixed widths in your theme or via CustomLayout htmls.
Last updated on
You cannot reply to this thread.