Scrollbar in verticalLayout

Hello;

I have a popup or I created a VerticalLayout or will have one button,
Clicking this button it adds a new text box,
The problem is that my popup disappears, and I can’t put a scrollbar instead enlarges the window and disappeared…

my code is :


VerticalLayout relativesLayout = new VerticalLayout();
relativesLayout.setWidth("350px");
Label relativesDescription = new Label("Voulez-vous ajouter un ....");
relativesLayout.addComponent(relativesDescription);
relativesLayout.addComponent(new Spacer());
        
addRelative();

relativesForm.setSpacing(true);
relativesLayout.addComponent(relativesForm);
        
Button addRelativeForm = new Button("Ajouter un proche", new Button.ClickListener()
     {
      	 @Override
         public void buttonClick(ClickEvent event)
           {
      		addRelative();
            }
        });

addRelativeForm.setStyleName(BaseTheme.BUTTON_LINK);
relativesLayout.addComponent(addRelativeForm);
relativesLayout.addComponent(new Spacer()); 

Thanks for your help

Not really sure if I undestood the question, but VerticalLayout’s don’t support scrolling by themselves. You have to put them into a panel to get scrolling. Window is a special case of a panel, so if you have that, then you should have scrolling.