Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

SelectFieldDefinition  renders a dropdown list.

Class: info.magnolia.ui.form.field.definition.SelectFieldDefinition

Here's an example configuration of a select field. All select fields (Option groupTwin-column, Checkbox) follow this pattern but some have additional properties.

Node nameValue

 pager

 

 options   

 

 none

 

 label

dialogs.paragraphs.features.stkSearchResult.tabMain.pager.options.none.label

 name

none

 selected

true

 value

 

 top

 

 label

dialogs.paragraphs.features.stkSearchResult.tabMain.pager.options.top.label

 name

top

 value

top

 bottom

 

 label

dialogs.paragraphs.features.stkSearchResult.tabMain.pager.options.bottom.label

 name

bottom

 value

bottom

 both

 

 label

dialogs.paragraphs.features.stkSearchResult.tabMain.pager.options.both.label

 name

both

 value

both

 class

info.magnolia.ui.form.field.definition.SelectFieldDefinition

 label

dialogs.paragraphs.features.stkSearchResult.tabMain.pager.label

 type

String

You can use all common field properties.

Common properties that apply to all select fields.

PropertyDescriptionDefault value

options

Parent node for the selectable options.

 

name

Name of the node where the selected value is stored. If not set, the name of the parent node is used. Optional. 

Parent node name

value

Value saved to the repository when selected. Mandatory.

 

label

The option label displayed to the user. Optional.

 

selected

Pre-selects the option. Optional.

 

path

Path to an existing option set as opposed to defining options in the current definition. Optional.

 

repository

When using a path to an existing option set, workspace to look in. Optional.

config

valueProperty

Read option values from a different property. Set to the name of your custom value node.

value

labelProperty

Read option labels from a different property. Set to the name of your custom label node.

label

textInputAllowed

When true, the user can type into the select field to filter the available options. The filteringMode property defines how the options are filtered: contains or starts with.

When false, the field behaves like a standard select field where the user can not enter text. Clicking the field opens the dropdown with options.

(warning) This property does not make it possible to enter new values into the field. The user can only choose from existing options.

false

filteringMode

Vaadin FilteringMode. Default is off. Available values are: contains and startswith.

(warning) To enable filtering, you must also:

  • Set the pageLength property to a value greater than 0 
  • Set the textInputAllowed property to true

off

sortOptions

By default, option labels are sorted alphabetically. When set to false, sorts the options per JCR node order.

true

pageLengthTo enable paging and filtering, value must be an integer > 0. 0 disables paging and filtering.0

Properties specific to the select field.