AutocompleteΒΆ

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

Warning

Deprecation

It is using Coral2 component, which will not be supported any longer. Use dedicated component for the purpose, such as PathField, or build your own field based on foundation-autocomplete.

An autocomplete component that gives a list of suggestions to help the user to complete the field.

It extends Field component.

It has the following content structure:

granite:FormAutocomplete
  1. granite:FormField
namestring

The name that identifies the field when submitting the form.

deleteHintboolean
  1. true

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

valuestring

The value of the field.

If multiple is false, the property type is StringEL, otherwise it is a multiple property of type String.

emptyTextstring
i18n

A hint to the user of what can be entered in the field.

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.

forceSelectionboolean

Indicates if the user is forced to select only from the available choices.

iconstring

The icon class.

values

The renderer to render the user selections (given by the options renderer).

options

The renderer to render the options to be displayed to the user.

Example:

+ myfield
  - sling:resourceType = "granite/ui/components/coral/foundation/form/autocomplete"
  - multiple = true
  + datasource
    - sling:resourceType = "cq/gui/components/common/datasources/tags"
  + values
    - sling:resourceType = "granite/ui/components/coral/foundation/form/autocomplete/tags"
  + options
    - sling:resourceType = "granite/ui/components/coral/foundation/form/autocomplete/list"

Components: