Oracle Fusion Middleware Tag Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81455-03

# <af:autoSuggestBehavior>

autoSuggestBehavior autosuggestbehavior

The autoSuggestBehavior tag is a declarative way to show the suggestItems in a dropdown for the editable components based on user input in the field.

suggestItems attribute needs to be bounded to a method with signature List<javax.model.SelectItem> suggestItems(javax.faces.context.FacesContext, oracle.adf.view.rich.model.AutoSuggestUIHints)
The labels of the selectItems will be displayed in the dropdown and when the user selects a particualr item the value will be selected and displayed in the input field.

When smartList is enabled, smartList will be filtered first to show the results. If no items are found in the smart list or user waits without any operation, the entire suggestedItems list will be fetched from the server to show in the dropdown.

When maxSuggestedItems is defined, only those number of suggestItems will be fetched from server and a More... link will be rendered in the autoSuggest popup indicating that there can be more suggest items matching the entered value.
When More... link is clicked, All the suggest items will be fetched from the server.

Note: If EL is used in the EL supported attributes of this tag, this tag will not be stampable.

<af:inputText id="inputText" label="String value" value="#{bean.value}"> <af:autoSuggestBehavior suggestItems="#{bean.suggestItems}" maxSuggestedItems="5" /> </af:inputText>

AutoSuggest behavior renders screen reader accessible content in regular rich rendering mode. It does not require usage of the screen reader mode, which is currently in the process of being phased out.

## Attributes

Name | Type | Supports EL? | Description
--- | --- | --- | ---

minChars | int | Yes | Default Value: 1 The minimum number of characters the user must type before a search is performed. Set to higher value than 1 if the search could match a lot of items.
maxSuggestedItems | int | Yes | Default Value: -1 The number of items to be returned from the suggestItems implementation. -1 would fetch all the records. This value is passed to suggestItems implementation via AutoSuggestUIHints class, and it is upto the suggestItems implementation to honor this.
smartList | javax.el.MethodExpression | Only EL | An EL expression pointing to the java method which returns List<javax.model.SelectItem> of the smart list items. This list is pre-fetched and is available on the UI widget before the user starts looking for suggestions by typing. Smart List is filtered on the client.
suggestedItems | javax.el.MethodExpression | Only EL | The attribute is deprecated, use suggestItems instead. An EL expression pointing to the java method which returns List<javax.model.SelectItem> of the suggestedItems. The method should take one string argument, submitted value
suggestItems | javax.el.MethodExpression | Only EL | An EL expression pointing to the java method which returns List<javax.model.SelectItem> of the suggestedItems. The method signature should be of the form List<javax.model.SelectItem> suggestItems(javax.faces.context.FacesContext, oracle.adf.view.rich.model.AutoSuggestUIHints)