Render an <input type="text"/> widget which provides
autocompletion via a list of values.
Contrary to deform.widget.AutocompleteInputWidget, it
can store a value that is different from the one it displays. The
attributes and arguments are the same as those of
deform.widget.AutocompleteInputWidget except the
following ones which replace or add to the former:
Attributes/Arguments
- template
- The template name used to render the widget. Default:
autocomplete_input_w_hidden.
- readonly_template
- The template name used to render the widget in read-only mode.
Default: readonly/autocomplete_input_w_hidden.
- values
- Either an iterable that can be converted to a JSON array, or a
string representing a URL. If the latter, an XMLHTTPRequest
will be sent to this URL to retrieve a JSON serialization of
an iterable. In either case, each value of the iterable must
be an associative array that has at least two keys: stored
and displayed. Both values must be strings. An optional
dropdown key may be provided, in which case it will be
used in the dropdown that appears when the user starts typing
characters in the text input widget. Default: () (the
empty tuple).
- display_value
- A callable that accepts two arguments: the field and the
cstruct (which usually corresponds to the value that is to
be stored – see Colander
documentation for further details). This callable should
return a string or unicode object that will be displayed in
the visible text input field once the user has selected an
item. Note that cstruct may be the empty string when the
field has not been filled. Default: lambda widget, field,
cstruct: cstruct