To enable building more complex forms by grouping inputs together into nested structures, Enonic XP supports the following types of sets:
|Schema description of a fieldset can be found here.|
A field set may be used to group items visually under a common label and distinguish this group from the rest of the form.
|Schema description of an item set can be found here.|
Item sets enable combining inputs (or other sets) into complex, nested structures. Item sets are grouped both visually and semantically, as the name of the item set is used in the persisted property structure.
A new or a single occurrence of an item set is by default expanded and can be collapsed by a click anywhere inside the item set header. Multiple occurrences of an item set will be collapsed by default to ensure better readability of a form containing several occurrences of complex item sets.
Label of an item set will dynamically change to value of the first non-empty field inside the set.
This helps to distinguish between multiple collapsed occurrences of the same item set without having to expand them.
Context menu of an item-set occurrence can be used to add a new occurrence of the set above or below the current one, or delete current occurrence. Add/delete actions can be disabled based on the item set’s occurrence configuration.
Item sets can be nested inside each other.
|Schema description of an option set can be found here.|
An option set is a group of options presented either as a radio-group (multi-select option set) or as a dropdown (single-select option set). Each option may have an optional underlying form for providing additional data.
By default, an option’s form will only be shown upon selection of the option, but a multi-select option set can be configured to have all of its options expanded by default. Forms of unselected options will be disabled until the option is selected.
Default behaviour of an option-set is very similar to an item-set: a single occurrence will by default be expanded, multiple occurrences will be collapsed. An occurrence can be expanded/collapsed by a click anywhere inside the header.
Form of a selected option can include simple inputs or more complex structures, like for example an item set:
Title of a multi-select option set occurrence will reflect labels of all selected options:
Use "Reset" action in the context menu of a single-select option set to change current selection: