Grouping components

Hello folks. I’m creating a form that will change based off of which radio button is selected

   if (radioGroup.getValue().contains("Item 3")){
      //Remove items from vertical layout
      //append new items to vertical layout
   }

Right now the items that get appended to my vertical layout are 2 upload file forms, 3 input fields, and submit button – is there some way to add all of these to a single component and call group.remove() on that group of components rather than removing them one by one, or is this something I should script into a method on the container itself?

You can wrap them in any other components, like a div

Gotcha, so if I just have a named div and then remove that it will remove all the children?

Correct

Worked as intended

else if(radioGroup.getValue().contains("Add new")){
                DistroForm DF = new DistroForm(parentPanel);
public class DistroForm {
    parentPane.div.removeAll();
    parentPane.div.add(button);
    parentPane.div.add(new Paragraph());

Worked as @quirky-zebra described – thanks bud :slightly_smiling_face: