Select¶
-
/libs/granite/ui/components/coral/foundation/form/select Select is a component to represent a concept of selection of some options.
It extends
Fieldcomponent.It has the following content structure:
-
granite:FormSelect
- granite:FormField
- 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
- true
trueto translate the options,falseotherwise.
-
orderedboolean
- false
trueto sort the options based on the text,falseotherwise.It is assumed that the options don’t contain option group.
-
emptyOptionboolean
- false
trueto also add an empty option;falseotherwise.Empty option is an option having both value and text equal to empty string.
-
variantstring
- default
- default
- quiet
The variant of the select.
-
deleteHintboolean
- true
trueto generate the SlingPostServlet @Delete hidden input based on the field name.
- forceIgnoreFreshnessboolean
trueto force to beignore-freshnessspecifically 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
selectedproperty of the item as usual.See
nameNotFoundModeproperty ofField.
Each option has the following structure:
-
granite:FormSelectItem
- granite:commonAttrs
- granite:renderCondition
- valuestringel
- mandatory
The value of the option.
- disabledboolean
Indicates if the option is in disabled state.
- selectedboolean
trueto pre-select this option,falseotherwise.
- 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
statusIconis also specified for a11y purpose.
-
statusVariantstring
- error
- warning
- success
- help
- info
The style of the status icon.
-
granite:FormSelect