Interface Typeahead<B>
- Type Parameters:
B- the builder type for method chaining
- All Known Implementing Classes:
FilterInputGroupTypeahead, MultiSelectTypeahead, SearchInputGroupTypeahead, SingleSelectTypeahead
public interface Typeahead<B>
Interface for components that combine a text input with a menu to provide typeahead/autocomplete behavior. A typeahead
component filters or refreshes its menu items based on user input.
The typeahead behavior is driven by a RefreshStrategy that evaluates each input change and returns a
Decision:
Decision.refresh()— re-query the server immediatelyDecision.debounce(int)— re-query the server after a debounce timeoutDecision.filter()— filter existing items locally (default when no strategy is set)Decision.keep()— do nothing, keep the current menu state as-is
-
Method Summary
Modifier and TypeMethodDescriptionfilter(SearchFilter searchFilter) Sets the filter used to match existing menu items against the current input value.onLoaded(ComponentHandler<B> handler) Adds a handler called when the menu has finished loading its items.onNoResults(NoResults noResults) Configures the behavior for generating a "no results" menu item when no matching items are found.onToggle(ToggleHandler<B> handler) Adds a handler called when the typeahead menu is expanded or collapsed.refreshOn(RefreshStrategy strategy) Sets the refresh strategy for asynchronously loaded items.
-
Method Details
-
refreshOn
Sets the refresh strategy for asynchronously loaded items. -
onLoaded
Adds a handler called when the menu has finished loading its items. -
onToggle
Adds a handler called when the typeahead menu is expanded or collapsed.
-