T - The type of the component extending form this classV - the type of the AbstractSuggestBox valuepublic abstract class AbstractSuggestBox<T extends AbstractSuggestBox<T,V>,V> extends AbstractValueBox<T,elemental2.dom.HTMLInputElement,V> implements HasSelectionHandler<T,SuggestItem<V>>
SuggestBoxStore while the user is
typing| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractSuggestBox.DropDownPositionDown
A
DropDownPosition that opens the suggestion dropdown menu down |
static class |
AbstractSuggestBox.DropDownPositionUp
A
DropDownPosition that opens the suggestion dropdown menu up |
static class |
AbstractSuggestBox.PopupPositionTopDown
A
DropDownPosition that opens the suggestion dropdown menu up or down based on the
largest space available, the menu will show where the is more space |
ValueBox.AutoValidate, ValueBox.AutoValidatorBasicFormElement.FieldHandler<T>BaseDominoElement.ElementHandler<T>, BaseDominoElement.ResizeHandler<T>, BaseDominoElement.StyleEditor<E extends elemental2.dom.HTMLElement,T extends org.jboss.elemento.IsElement<E>>, BaseDominoElement.WavesStylerHasSelectionHandler.SelectionHandler<V>HasChangeHandlers.ChangeHandler<V>HasValidation.ValidatorchangeHandlers, changeListener, DISABLED, fieldContainer, fieldGroup, FLOATING, FOCUSED, inputContainer, inputListenerelement| Constructor and Description |
|---|
AbstractSuggestBox()
Creates an instance without a label and a null store
|
AbstractSuggestBox(String label)
Creates an instance with a label and a null store
|
AbstractSuggestBox(String type,
String label,
SuggestBoxStore<V> store)
Creates an instance with a label and initialized with the input type and a store
|
AbstractSuggestBox(String label,
SuggestBoxStore<V> store)
Creates an instance with a label and initialized with a store
|
AbstractSuggestBox(SuggestBoxStore<V> store)
Creates an instance without a label and initialized with a store
|
| Modifier and Type | Method and Description |
|---|---|
T |
addSelectionHandler(HasSelectionHandler.SelectionHandler<SuggestItem<V>> selectionHandler)
Adds a Selection handler to the component
|
protected void |
clearValue(boolean silent)
clear the field value
|
protected ValueBox.AutoValidator |
createAutoValidator(ValueBox.AutoValidate autoValidate)
Create an AutoValidator that will automatically validate the component when it loses focus
|
protected elemental2.dom.HTMLInputElement |
createInputElement(String type)
Creates an input element with the specified type
|
protected void |
doSetValue(V value) |
protected DropdownAction<V> |
dropdownAction(SuggestItem<V> suggestItem) |
DelayedTextInput.DelayedAction |
getDelayedAction() |
DelayedTextInput |
getDelayedTextInput() |
String |
getDropdownMaxWidth() |
Color |
getHighlightColor() |
Loader |
getLoader() |
SuggestBoxStore<V> |
getStore() |
String |
getStringValue() |
DropDownMenu |
getSuggestionsMenu() |
int |
getTypeAheadDelay() |
V |
getValue() |
boolean |
isAutoSelect() |
boolean |
isEmptyAsNull() |
boolean |
isFocusOnClose() |
T |
removeSelectionHandler(HasSelectionHandler.SelectionHandler<SuggestItem<V>> selectionHandler) |
void |
search()
Filter the items based on the currently typed text in the AbstractSuggestBox
|
T |
setAutoSelect(boolean autoSelect) |
T |
setDelayedAction(DelayedTextInput.DelayedAction delayedAction)
Set a custom action to be executed after the user stops typing that override the default search
action
|
T |
setDropdownMaxWidth(String dropdownMaxWidth) |
T |
setEmptyAsNull(boolean emptyAsNull) |
T |
setFocusOnClose(boolean focusOnClose) |
T |
setHighlightColor(Color highlightColor)
Set the color to be used to highlight parts of the SuggestItems that matches the typed String
in the text input
|
T |
setLoaderEffect(LoaderEffect loaderEffect)
Sets a custom loader effect to be visible while the store is retrieving the suggestions
|
T |
setOnEnterAction(DelayedTextInput.DelayedAction onEnterAction)
Sets the action to be executed when the user press Enter to override the default search action
|
T |
setSuggestBoxStore(SuggestBoxStore<V> store) |
T |
setType(String type) |
T |
setTypeAheadDelay(int delayMilliseconds) |
getMaxLength, getMinLength, getMinLengthErrorMessage, isEmpty, isEmptyIgnoreSpaces, setMaxLength, setMinLength, setMinLengthErrorMessage, setReadOnly, updateCharacterCount, valueaddChangeHandler, addLeftAddOn, addLeftAddOn, addLeftAddOn, addOnClearHandler, addRightAddOn, addRightAddOn, addRightAddOn, allowEmptyLabel, asTableField, autoValidate, callChangeHandlers, changeLabelFloating, clear, clear, clearInvalid, clearValue, condense, createLabelElement, createMandatoryAddOn, disable, doFocus, doUnfocus, element, enable, floating, floatLabel, focus, getAdditionalInfoContainer, getCountItem, getErrorItem, getErrorsContainer, getFieldContainer, getFieldGroup, getFieldInputContainer, getFieldStyle, getFocusColor, getHelperContainer, getHelpItem, getInputContainer, getInputElement, getLabelElement, getLabelTextElement, getLeftAddonContainer, getLeftAddOnsContainer, getMandatoryAddOn, getNotesContainer, getOnClearHandlers, getPlaceholder, getPostfix, getPostFixItem, getPrefix, getPrefixItem, getRightAddonContainer, getRightAddOnsContainer, hasChangeHandler, hideLabelText, hidePlaceholder, invalidate, invalidate, isAddFocusColor, isAutoValidation, isFloating, isFocused, isReadOnly, linkLabelToField, nonfloating, onEnterKey, pauseChangeHandlers, pauseFocusValidation, removeChangeHandler, removeLeftAddOn, removeLeftAddOn, removeLeftAddOn, removeLeftAddOn, removeLeftAddOns, removeOnClearHandler, removeRightAddOn, removeRightAddOn, removeRightAddOn, removeRightAddOn, removeRightAddOns, resumeChangeHandlers, resumeFocusValidation, setAutoValidation, setFieldStyle, setFixErrorsPosition, setFloating, setFocusColor, setLabel, setLabel, setLabel, setLabel, setLabelTextVisible, setPauseChangeHandlers, setPlaceholder, setPostFix, setPrefix, setSpellCheck, setTableField, shouldShowPlaceholder, showLabelText, showPlaceholder, spread, unfloatLabel, unfocus, updateLabel, valueaddValidator, getErrorLabels, getErrors, getHelperText, getLabel, getName, getRequiredErrorMessage, groupBy, hasValidator, isDisabled, isEnabled, isFixErrorsPosition, isRequired, isShowRequiredIndicator, isValidationDisabled, makeErrorLabel, removeValidator, setHelperText, setName, setRequired, setRequired, setRequiredErrorMessage, setShowRequiredIndicator, setValidationDisabled, setValue, showErrors, ungroup, validate, withValidationDisabledadd, add, addClickListener, addCss, addCss, addEventListener, addEventListener, addEventsListener, addHideListener, addShowListener, alignCenter, alignRight, appendChild, appendChild, apply, attr, blur, childNodes, clearElement, contains, contains, contains, containsCss, css, css, cssClassByIndex, cssClassesCount, cssText, elevate, elevate, firstChild, getAttachObserver, getAttribute, getBoundingClientRect, getChildElementCount, getClickableElement, getCollapsible, getCollapsibleElement, getDetachObserver, getDominoId, getElementsCount, getElevation, getFirstChild, getId, getTextContent, getTooltip, getWavesElement, hasAttribute, hasChildNodes, hasDirectChild, hide, hideOn, id, init, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, insertFirst, insertFirst, insertFirst, isAttached, isCollapsed, isEmptyElement, isEqualNode, isForceHidden, isHidden, item, lastChild, length, onAttached, onDetached, onResize, pullLeft, pullRight, querySelector, querySelectorAll, remove, removeAttachObserver, removeAttribute, removeChild, removeChild, removeCss, removeCss, removeCssProperty, removeDetachObserver, removeEventListener, removeEventListener, removeHideListener, removeHideOn, removeShowListener, removeShowOn, removeTooltip, removeWaves, replaceCss, setAlignItems, setAttribute, setAttribute, setAttribute, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBottom, setBottom, setBoxShadow, setCollapseStrategy, setColor, setColor, setContent, setContent, setCssProperty, setCssProperty, setCursor, setCursor, setDisabled, setDisplay, setDisplay, setDropMenu, setFlex, setFloat, setFloat, setFontSize, setFontSize, setForceHidden, setHeight, setHeight, setId, setInnerHtml, setLeft, setLeft, setLineHeight, setLineHeight, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setOpacity, setOpacity, setOverFlow, setOverFlow, setOverFlowY, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPointerEvents, setPosition, setPosition, setRight, setRight, setTabIndex, setTextAlign, setTextAlign, setTextContent, setTooltip, setTooltip, setTooltip, setTooltip, setTop, setTop, setTransitionDuration, setWidth, setWidth, setZIndex, show, showOn, style, style, styler, textContent, toggleDisplay, toggleDisplay, withWaves, withWavesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateAllisExpandedadd, add, remove, remove, removeProperty, replace, setProperty, setPropertypublic AbstractSuggestBox()
public AbstractSuggestBox(String label)
label - String labelpublic AbstractSuggestBox(SuggestBoxStore<V> store)
store - SuggestBoxStorepublic AbstractSuggestBox(String label, SuggestBoxStore<V> store)
label - Stringstore - SuggestBoxStorepublic AbstractSuggestBox(String type, String label, SuggestBoxStore<V> store)
type - String input element typelabel - Stringstore - SuggestBoxStorepublic final void search()
protected elemental2.dom.HTMLInputElement createInputElement(String type)
createInputElement in class ValueBox<T extends AbstractSuggestBox<T,V>,elemental2.dom.HTMLInputElement,V>type - String the input element typepublic int getTypeAheadDelay()
public T setTypeAheadDelay(int delayMilliseconds)
delayMilliseconds - int delay in milliseconds before triggering the search after the user
stops typingpublic DelayedTextInput.DelayedAction getDelayedAction()
DelayedTextInput.DelayedActionpublic T setDelayedAction(DelayedTextInput.DelayedAction delayedAction)
delayedAction - DelayedTextInput.DelayedActionpublic T setOnEnterAction(DelayedTextInput.DelayedAction onEnterAction)
onEnterAction - DelayedTextInput.DelayedActionprotected void clearValue(boolean silent)
clearValue in class ValueBox<T extends AbstractSuggestBox<T,V>,elemental2.dom.HTMLInputElement,V>protected void doSetValue(V value)
doSetValue in class ValueBox<T extends AbstractSuggestBox<T,V>,elemental2.dom.HTMLInputElement,V>value - V the value to set for this fieldpublic V getValue()
public T setSuggestBoxStore(SuggestBoxStore<V> store)
store - SuggestBoxStorepublic T setType(String type)
type - String type of the htmml input elementpublic String getStringValue()
getStringValue in interface HasInputElementgetStringValue in class ValueBox<T extends AbstractSuggestBox<T,V>,elemental2.dom.HTMLInputElement,V>protected final DropdownAction<V> dropdownAction(SuggestItem<V> suggestItem)
public T addSelectionHandler(HasSelectionHandler.SelectionHandler<SuggestItem<V>> selectionHandler)
addSelectionHandler in interface HasSelectionHandler<T extends AbstractSuggestBox<T,V>,SuggestItem<V>>selectionHandler - Selectable.SelectionHandlerpublic T removeSelectionHandler(HasSelectionHandler.SelectionHandler<SuggestItem<V>> selectionHandler)
removeSelectionHandler in interface HasSelectionHandler<T extends AbstractSuggestBox<T,V>,SuggestItem<V>>public T setLoaderEffect(LoaderEffect loaderEffect)
loaderEffect - LoaderEffectpublic T setEmptyAsNull(boolean emptyAsNull)
emptyAsNull - boolean, if ture empty value will be considered null otherwise it is an
empty Stringpublic boolean isEmptyAsNull()
public SuggestBoxStore<V> getStore()
SuggestBoxStore of this AbstractSuggestBoxpublic DelayedTextInput getDelayedTextInput()
DelayedTextInput of this AbstractSuggestBoxpublic DropDownMenu getSuggestionsMenu()
DropDownMenu of the AbstractSuggestBoxpublic Color getHighlightColor()
public T setHighlightColor(Color highlightColor)
highlightColor - Colorprotected ValueBox.AutoValidator createAutoValidator(ValueBox.AutoValidate autoValidate)
createAutoValidator in class ValueBox<T extends AbstractSuggestBox<T,V>,elemental2.dom.HTMLInputElement,V>autoValidate - ValueBox.AutoValidatepublic boolean isAutoSelect()
public T setAutoSelect(boolean autoSelect)
autoSelect - boolean, if true pressing enter will automatically select the first entry
from the Suggestions menupublic String getDropdownMaxWidth()
public T setDropdownMaxWidth(String dropdownMaxWidth)
dropdownMaxWidth - maximal width of dropdown. if null - equals width of controlpublic boolean isFocusOnClose()
public T setFocusOnClose(boolean focusOnClose)
focusOnClose - boolean, if true after closing the suggestions menu the focus will go back
to the suggest box inputCopyright © 2019–2022 Dominokit. All rights reserved.