Class SingleTypeahead
java.lang.Object
org.patternfly.component.ComponentDelegate<HTMLElement, SingleTypeahead>
org.patternfly.component.menu.SingleTypeahead
- All Implemented Interfaces:
Attachable,ElementAttributeMethods<HTMLElement, SingleTypeahead>,ElementClassListMethods<HTMLElement, SingleTypeahead>,ElementConsumerMethods<HTMLElement, SingleTypeahead>,ElementContainerMethods<HTMLElement, SingleTypeahead>,ElementEventMethods<HTMLElement, SingleTypeahead>,ElementIdMethods<HTMLElement, SingleTypeahead>,ElementQueryMethods<HTMLElement>,HTMLElementAttributeMethods<HTMLElement, SingleTypeahead>,HTMLElementDataMethods<HTMLElement, SingleTypeahead>,HTMLElementStyleMethods<HTMLElement, SingleTypeahead>,HTMLElementVisibilityMethods<HTMLElement, SingleTypeahead>,IsElement<HTMLElement>,TypedBuilder<HTMLElement, SingleTypeahead>,Component,Expandable<HTMLElement, SingleTypeahead>,HasValue<String>,Modifiers.Disabled<HTMLElement, SingleTypeahead>
public class SingleTypeahead
extends ComponentDelegate<HTMLElement, SingleTypeahead>
implements HasValue<String>
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 TypeMethodDescriptionapplyTo(Consumer<MenuToggle> consumer) Provides access to the underlying menu toggle using a fluent API stylevoidattach(MutationRecord mutationRecord) voidcollapse(boolean fireEvent) voiddetach(MutationRecord mutationRecord) disabled(boolean disabled) voidexpand(boolean fireEvent) flip(boolean flip) booleanmenu()onLoaded(ComponentHandler<SingleTypeahead> loadedHandler) onNoResults(Function<String, MenuItem> noResults) Defines the behavior when no results are found during a search.onSearch(SearchFilter searchFilter) Configures the search behavior for this typeahead.onToggle(ToggleHandler<SingleTypeahead> toggleHandler) voidvoidvoidvoidstatic SingleTypeaheadsingleTypeahead(String id, String placeholder) Creates a newSingleTypeaheadcomponent with aMenuToggleof typeMenuToggleType.typeaheadand aSearchInput.static SingleTypeaheadsingleTypeahead(MenuToggle menuToggle) Creates a newSingleTypeaheadcomponent with the givenMenuToggle.stayOpen()that()value()zIndex(int zIndex) Methods 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
disabled
-
Method Details
-
singleTypeahead
Creates a newSingleTypeaheadcomponent with aMenuToggleof typeMenuToggleType.typeaheadand aSearchInput. -
that
- Specified by:
thatin interfaceTypedBuilder<HTMLElement, SingleTypeahead>
-
onNoResults
Defines the behavior when no results are found during a search. This method allows setting aFunctionthat takes a search query as input and provides aMenuItemto be displayed when no matching results are found.By default, a "No results found" message is displayed.
- Parameters:
noResults- aFunctionthat accepts aStringparameter representing the search query, and returns aMenuItemto display for no results.- Returns:
- the
SingleTypeaheadinstance for method chaining.
-
select
-
select
-
value
-
attach
- Specified by:
attachin interfaceAttachable
-
detach
- Specified by:
detachin interfaceAttachable
-
applyTo
Provides access to the underlying menu toggle using a fluent API style -
disabled
- Specified by:
disabledin interfaceModifiers.Disabled<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabledin interfaceModifiers.Disabled<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-
flip
-
placement
-
stayOpen
-
stayOpen
-
zIndex
-
ariaLabel
-
onLoaded
-
onToggle
-
collapse
public void collapse(boolean fireEvent) - Specified by:
collapsein interfaceExpandable<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-
expand
public void expand(boolean fireEvent) - Specified by:
expandin interfaceExpandable<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-