Select ====== .. granite:servercomponent:: /libs/granite/ui/components/coral/foundation/form/select :supertype: /libs/granite/ui/components/coral/foundation/form/field Select is a component to represent a concept of selection of some options. It extends :granite:servercomponent:`Field ` component. It has the following content structure: .. gnd:gnd:: [granite:FormSelect] > granite:FormField, granite:container /** * The name that identifies the field when submitting the form. */ - name (String) /** * The initial text to display when nothing is selected. */ - emptyText (String) i18n /** * Indicates if the field is in disabled state. */ - disabled (Boolean) /** * Indicates if the field is mandatory to be filled. */ - required (Boolean) /** * The name of the validator to be applied. E.g. ``foundation.jcr.name``. * See :doc:`validation ` in Granite UI. */ - validation (String) multiple /** * Indicates if the user is able to select multiple selections. */ - multiple (Boolean) /** * ``true`` to translate the options, ``false`` otherwise. */ - translateOptions (Boolean) = true /** * ``true`` to sort the options based on the text, ``false`` otherwise. * * It is assumed that the options don't contain option group. */ - ordered (Boolean) = false /** * ``true`` to also add an empty option; ``false`` otherwise. * * Empty option is an option having both value and text equal to empty string. */ - emptyOption (Boolean) = false /** * The variant of the select. */ - variant (String) = 'default' < 'default', 'quiet' /** * ``true`` to generate the `SlingPostServlet @Delete `_ hidden input based on the field name. */ - deleteHint (Boolean) = true /** * ``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 :granite:servercomponent:`Field `. */ - forceIgnoreFreshness (Boolean) Each option has the following structure: .. gnd:gnd:: [granite:FormSelectItem] > granite:commonAttrs, granite:renderCondition /** * The value of the option. */ - value (StringEL) mandatory /** * Indicates if the option is in disabled state. */ - disabled (Boolean) /** * ``true`` to pre-select this option, ``false`` otherwise. */ - selected (Boolean) /** * The text of the option. */ - text (String) i18n /** * The icon of the option. */ - icon (String) /** * The icon describing the status of the option. */ - statusIcon (String) /** * The text describing the status. * It is RECOMMENDED that it is specified when ``statusIcon`` is also specified for a11y purpose. */ - statusText (String) i18n /** * The style of the status icon. */ - statusVariant (String) < 'error', 'warning', 'success', 'help', 'info'