Class MultiTypeahead
java.lang.Object
org.patternfly.component.ComponentDelegate<HTMLElement, MultiTypeahead>
org.patternfly.component.menu.MenuToggleMenu<MultiTypeahead>
org.patternfly.component.menu.MultiTypeahead
- All Implemented Interfaces:
Attachable,ElementAttributeMethods<HTMLElement, MultiTypeahead>,ElementClassListMethods<HTMLElement, MultiTypeahead>,ElementConsumerMethods<HTMLElement, MultiTypeahead>,ElementContainerMethods<HTMLElement, MultiTypeahead>,ElementEventMethods<HTMLElement, MultiTypeahead>,ElementIdMethods<HTMLElement, MultiTypeahead>,ElementQueryMethods<HTMLElement>,HTMLElementAttributeMethods<HTMLElement, MultiTypeahead>,HTMLElementDataMethods<HTMLElement, MultiTypeahead>,HTMLElementStyleMethods<HTMLElement, MultiTypeahead>,HTMLElementVisibilityMethods<HTMLElement, MultiTypeahead>,IsElement<HTMLElement>,TypedBuilder<HTMLElement, MultiTypeahead>,Component,Expandable<HTMLElement, MultiTypeahead>,Typeahead<MultiTypeahead>,Modifiers.Disabled<HTMLElement, MultiTypeahead>
public class MultiTypeahead
extends MenuToggleMenu<MultiTypeahead>
implements Typeahead<MultiTypeahead>
A typeahead is a select variant that replaces the typical button toggle for opening the select menu with a text input and
button toggle combo. As a user enters characters into the text input, the menu options will be filtered to match.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAllows the creation of new menu items based on user input.voidclear()voidclear(boolean fireEvent) static MultiTypeaheadmultiTypeahead(String id, String placeholder) Creates a newMultiTypeaheadcomponent with aMenuToggleof typeMenuToggleType.typeaheadand aFilterInput.static MultiTypeaheadmultiTypeahead(BaseFilterInput<?> filterInput) Creates a newMultiTypeaheadcomponent with aMenuToggleof typeMenuToggleType.typeaheadand the specifiedBaseFilterInput.onNoResults(NoResults noResults) Configures the behavior for generating a "no results" menu item when no matching items are found in the menu list for the given input text.onSearch(SearchFilter searchFilter) Configures the search behavior for this typeahead.voidselectIdentifiers(List<String> identifiers) voidselectIdentifiers(List<String> identifiers, boolean fireEvent) voidselectItems(List<MenuItem> items) voidselectItems(List<MenuItem> items, boolean fireEvent) that()Methods inherited from class org.patternfly.component.menu.MenuToggleMenu
addMenu, applyTo, ariaLabel, attach, collapse, detach, disabled, expand, flip, isDisabled, menu, menuToggle, onLoaded, onToggle, placement, stayOpen, stayOpen, zIndexMethods inherited from class org.patternfly.component.ComponentDelegate
componentType, elementMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.elemento.ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface org.jboss.elemento.ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface org.jboss.elemento.ElementConsumerMethods
apply, runMethods inherited from interface org.jboss.elemento.ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface org.jboss.elemento.ElementEventMethods
on, on, onMethods inherited from interface org.jboss.elemento.ElementIdMethods
id, uniqueIdMethods inherited from interface org.jboss.elemento.ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface org.patternfly.component.Expandable
collapse, expand, expanded, toggle, toggleMethods inherited from interface org.jboss.elemento.HTMLElementAttributeMethods
titleMethods inherited from interface org.jboss.elemento.HTMLElementDataMethods
dataMethods inherited from interface org.jboss.elemento.HTMLElementStyleMethods
style, style, style, style, style, styleMethods inherited from interface org.jboss.elemento.HTMLElementVisibilityMethods
hiddenMethods inherited from interface org.patternfly.style.Modifiers.Disabled
disabledMethods inherited from interface org.patternfly.component.menu.Typeahead
allowNewItems
-
Method Details
-
multiTypeahead
Creates a newMultiTypeaheadcomponent with aMenuToggleof typeMenuToggleType.typeaheadand aFilterInput. -
multiTypeahead
Creates a newMultiTypeaheadcomponent with aMenuToggleof typeMenuToggleType.typeaheadand the specifiedBaseFilterInput.- Parameters:
filterInput- theBaseFilterInputinstance used to configure the typeahead component with filtering and search capabilities- Returns:
- a new
MultiTypeaheadinstance configured with the given filter input
-
allowNewItems
public MultiTypeahead allowNewItems(Function<String, String> prompt, Function<String, Promise<MenuItem>> createItem) Description copied from interface:TypeaheadAllows the creation of new menu items based on user input. This method enables a typeahead component to provide functionality for dynamically adding custom items when the user-provided input does not match any existing items.- Specified by:
allowNewItemsin interfaceTypeahead<MultiTypeahead>- Parameters:
prompt- aFunctionthat takes aStringinput representing the user's data and returns aStringresponse, typically used to prompt the user or display a message.createItem- aFunctionthat takes aStringinput representing the user's data and returns aPromiseof aMenuItem, representing the newly created item.- Returns:
- an instance of the enclosing type, enabling method chaining for further configuration.
-
that
- Specified by:
thatin interfaceTypedBuilder<HTMLElement, MultiTypeahead>
-
clear
public void clear() -
clear
public void clear(boolean fireEvent) -
selectIdentifiers
-
selectIdentifiers
-
selectItems
-
selectItems
-