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
- 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
true
to translate the options,false
otherwise.
-
orderedboolean
- false
true
to sort the options based on the text,false
otherwise.It is assumed that the options don’t contain option group.
-
emptyOptionboolean
- 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
- default
- default
- quiet
The variant of the select.
-
deleteHintboolean
- true
true
to generate the SlingPostServlet @Delete hidden input based on the field name.
- forceIgnoreFreshnessboolean
true
to force to beignore-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 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
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
- error
- warning
- success
- help
- info
The style of the status icon.
-
granite:FormSelect