If you’re here looking for information on reusable field sets, you’re in the right place. We call them Element Sets in the Liferay Forms application because these sets include more than just fields: they include the layout and configuration of the fields as well. In the future, additional styling elements will be available here, too.
Element sets are more like composable Form fragments or reusable Form blocks.
Sometimes you might be able to create an entire form by composing existing Element Sets. Your colleagues might call you lazy, but we’d call you industrious.
To create Element Sets, go to Site Menu → Content &Data → Forms. The Forms view is displayed by default. Click the Element Sets tab, and any existing Element Sets appear, just like existing Forms are displayed in the Forms view. Click the Add button ().
Here’s the thing. If you know how to create a Form, you already know how to create an Element Set. The process is identical. Drag and drop elements onto the form builder palette, configuring fields as you go.
When you’re finished, click Save. Element Sets aren’t publishable, so there’s no button for that.
Once an Element Set is saved, it’s instantly available for use, even in the same Element Set. That’s right, you can use Element Sets to create Element Sets.
To use an Element Set in a Form:
Open the Form Builder.
If the Add Elements sidebar isn’t already displayed, open it by clicking the Add button ().
The default view in the Add Elements sidebar is Elements. Instead click Element Sets.
Drag the Element Set onto the Form Builder, just like you would any single Form Element.
You probably already guessed that the process is identical for using Element Sets to build other Element Sets. That’s all there is to it. There are just a couple more things to note:
Once an Element Set is added to a Form, there’s no connection with the root Element Set. You’re free to move or configure the Fields and Elements however you want.
Editing an Element Set doesn’t retroactively affect the Forms where the Element Set was used.
Think ahead. Are there some common fields you’ll commonly need to configure in your Forms? If so, create them as Element Sets once and save yourself repetitive work.