DEPRECATED
This select field definition has been deprecated since Magnolia 6.0. It is part of the Magnolia 5 UI framework.
For the updated implementation, see Select field for Magnolia 6 UI instead.
SelectFieldDefinition renders a dropdown list.
class: info.magnolia.ui.form.field.definition.SelectFieldDefinition
fieldType: select
Example select field definition
form: tabs: - name: tabLink label: Link fields: - name: listStyle fieldType: select label: List style options: - name: bullet value: bullet selected: true label: Bullet - name: ordered value: ordered label: Ordered - name: inline value: inline label: Inline
Select field properties
The select, option group and twin-column fields share this general configuration pattern, but they also have their own additional properties.
<field name> | required Name of the field. |
| optional Parent node for the selectable options. If not set, the field generates options from the repository path. |
| Name of the option. |
| required Value saved to the repository when selected. |
| optional, default is the parent node name Name of the node where the selected value is stored. If not set, the name of the parent node is used. |
| optional Option label displayed to the user. |
| optional Displays an image next to the option. Value is a path to the image. |
| optional, default is Pre-selects the option. |
| optional, default is Reads option labels from a different property. Set to the name of your custom label node. |
| optional Path to existing options as opposed to defining options in the current definition. Only valid with a field defined in XML. Alternatively, option definitions can be placed in a YAML file referenced via |
| optional, default is When using a path to existing options, workspace to look in. |
| optional, default is By default, option labels are sorted alphabetically. When |
| optional, default is When |
| optional, default is Reads option values from a different property. Set to the name of your custom value node. |
Additional properties
| optional, default is When When This property does not make it possible to enter new values into the field. The user can only choose from existing options. |
| optional, default is Vaadin To enable filtering, you must also:
|
| optional, default is To enable paging and filtering, value must be an integer greater than |
See also Common field properties.
Filtered select field
Here is an example select field that uses the startswith
filtering mode and 10 options per page.
form: tabs: - name: tabAddress fields: - name: country fieldType: select label: Country filteringMode: startswith pageLength: 10 textInputAllowed: true options: - name: afghanistan value: afghanistan - name: argentina value: argentina - name: australia value: australia - name: austria value: austria - name: belgium value: belgium - name: brazil value: brazil - name: bulgaria value: bulgaria - name: canada value: canada - name: chad value: chad - name: chile value: chile - name: china value: china - name: cuba value: cuba - name: czech-republic value: czech-republic - name: denmark value: denmark
Node name | Value |
---|---|
form | |
tabs | |
tabAddress | |
fields | |
country | |
options | |
afghanistan | |
value | afghanistan |
argentina | |
value | argentina |
australia | |
value | australia |
austria | |
value | austria |
belgium | |
value | belgium |
brazil | |
value | brazil |
bulgaria | |
value | bulgaria |
canada | |
value | canada |
chad | |
value | chad |
chile | |
value | chile |
china | |
value | china |
cuba | |
value | cuba |
czech-republic | |
value | czech-republic |
denmark | |
value | denmark |
fieldType | select |
filteringMode | startswith |
pageLength | 10 |
textInputAllowed | true |