I have a FieldGroup containing fields for an Entity.
I want to show and hide fields depending on a dropdown, which is fine using setVisible() on the component. However when invisible, the fields still take up the space in the layout, I want a way of rearranging the fields so that ones lower in the page move up the page rather than an ugly gap between fields. Similar to the Android mechanism of “Gone” versus “Visible” where gone means that the field is no longer used in the layout setup.
i need the same functionallity in one of my projects. i split one field of my e.g. four fields, contained in one field group, into a seperate field group, so i now have two field group items with either three and one field.
now i went ahead an hid the field in the seperate field group.
and changing an option in my application, the two upper checkboxes and the textbox gets hidden:
the field group beneath them moves to the free area i think thats what you need? it’s really basically only two field group items and i hide the above one.
Hi @LloydS, @dannywall55s, @mark.butler
You can simply remove the field from the FieldGroup using removeField("field_id") method.
For example, let’s assume that you want to delete the email field from the User editor screen. The following code will help you to do so
@Override
public void postInit() {
fieldGroupLeft.removeField("email");
}