Select

/libs/granite/ui/components/coral/foundation/form/select

Select is a component to represent a concept of selection of some options.

It extends Field component.

It has the following content structure:

granite:FormSelect
  1. granite:FormField
  2. granite:container
namestring

The name that identifies the field when submitting the form.

emptyTextstring
i18n

The initial text to display when nothing is selected.

disabledboolean

Indicates if the field is in disabled state.

requiredboolean

Indicates if the field is mandatory to be filled.

validationstring
multiple

The name of the validator to be applied. E.g. foundation.jcr.name. See validation in Granite UI.

multipleboolean

Indicates if the user is able to select multiple selections.

translateOptionsboolean
  1. true

true to translate the options, false otherwise.

orderedboolean
  1. false

true to sort the options based on the text, false otherwise.

It is assumed that the options don’t contain option group.

emptyOptionboolean
  1. false

true to also add an empty option; false otherwise.

Empty option is an option having both value and text equal to empty string.

variantstring
  1. default
  1. default
  2. quiet

The variant of the select.

deleteHintboolean
  1. true

true to generate the SlingPostServlet @Delete hidden input based on the field name.

forceIgnoreFreshnessboolean

true to force to be ignore-freshness specifically just for this field.

This property is useful when you have a newly introduced field in the form, and there is a need to specifically set the default selected item. To set the default selected item, set the selected property of the item as usual.

See nameNotFoundMode property of Field.

Each option has the following structure:

granite:FormSelectItem
  1. granite:commonAttrs
  2. granite:renderCondition
valuestringel
mandatory

The value of the option.

disabledboolean

Indicates if the option is in disabled state.

selectedboolean

true to pre-select this option, false otherwise.

textstring
i18n

The text of the option.

iconstring

The icon of the option.

statusIconstring

The icon describing the status of the option.

statusTextstring
i18n

The text describing the status. It is RECOMMENDED that it is specified when statusIcon is also specified for a11y purpose.

statusVariantstring
  1. error
  2. warning
  3. success
  4. help
  5. info

The style of the status icon.