Package io.jmix.ui.component
Interface ComboBox<V>
- Type Parameters:
V- type of options and value
- All Superinterfaces:
Buffered,Component,Component.BelongToFrame,Component.Editable,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,Field<V>,HasContextHelp,HasEnterPressHandler,HasFilterMode,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,HasInputPrompt,HasOptionCaptionProvider<V>,HasOptionIconProvider<V>,HasOptionImageProvider<V>,HasOptionStyleProvider<V>,HasValidator<V>,HasValue<V>,HasValueSource<V>,OptionsField<V,,V> Requirable,Validatable
- All Known Subinterfaces:
EntityComboBox<V>
- All Known Implementing Classes:
ComboBoxImpl,EntityComboBoxImpl
@StudioComponent(caption="ComboBox",
category="Components",
xmlElement="comboBox",
icon="io/jmix/ui/icon/component/comboBox.svg",
canvasBehaviour=COMBO_BOX,
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/combo-box.html")
public interface ComboBox<V>
extends OptionsField<V,V>, HasInputPrompt, Buffered, Component.Focusable, HasOptionStyleProvider<V>, HasOptionIconProvider<V>, HasOptionImageProvider<V>, HasFilterMode, HasEnterPressHandler
A filtering dropdown single-select component. Items are filtered based on user input.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classCaption filtering context.Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.HasEnterPressHandler
HasEnterPressHandler.EnterPressEventNested classes/interfaces inherited from interface io.jmix.ui.component.HasFilterMode
HasFilterMode.FilterModeNested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V> -
Field Summary
FieldsFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptionintReturns the suggestion popup's width as a string.booleanbooleanbooleanstatic <T> org.springframework.core.ParameterizedTypeReference<ComboBox<T>>voidsetAutomaticPopupOnFocus(boolean automaticPopupOnFocus) When enabled popup automatically opens on focus.voidsetNullOptionVisible(boolean nullOptionVisible) Sets visibility for first null element in suggestion popup.voidsetNullSelectionCaption(String nullOption) Sets the null selection caption.voidSets a predicate that tests whether an item with the given caption matches to the given search string.voidsetPageLength(int pageLength) Sets the page length for the suggestion popup.voidsetPopupWidth(String width) Sets the suggestion popup's width as a string.voidsetTextInputAllowed(boolean textInputAllowed) Sets whether it is possible to input text into the field or whether the field area of the component is just used to show what is selected.Methods inherited from interface io.jmix.ui.component.Buffered
commit, discard, isBuffered, isModified, setBufferedMethods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditableMethods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndexMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasEnterPressHandler
getEnterPressHandler, setEnterPressHandlerMethods inherited from interface io.jmix.ui.component.HasFilterMode
getFilterMode, setFilterModeMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods inherited from interface io.jmix.ui.component.HasInputPrompt
getInputPrompt, setInputPromptMethods inherited from interface io.jmix.ui.component.HasOptionCaptionProvider
getOptionCaptionProvider, setOptionCaptionProviderMethods inherited from interface io.jmix.ui.component.HasOptionIconProvider
getOptionIconProvider, setOptionIconProviderMethods inherited from interface io.jmix.ui.component.HasOptionImageProvider
getOptionImageProvider, setOptionImageProviderMethods inherited from interface io.jmix.ui.component.HasOptionStyleProvider
getOptionStyleProvider, setOptionStyleProviderMethods inherited from interface io.jmix.ui.component.HasValidator
addValidator, addValidators, getValidators, removeValidatorMethods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValueMethods inherited from interface io.jmix.ui.component.data.HasValueSource
getValueSource, setValueSourceMethods inherited from interface io.jmix.ui.component.OptionsField
getOptions, setOptions, setOptionsEnum, setOptionsList, setOptionsMapMethods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessageMethods inherited from interface io.jmix.ui.component.Validatable
isValid, isValidateOnCommit, validate
-
Field Details
-
NAME
- See Also:
-
TYPE_STRING
-
-
Method Details
-
of
-
getNullSelectionCaption
String getNullSelectionCaption()- Returns:
- the null selection caption, not
null
-
setNullSelectionCaption
@StudioProperty(name="nullName", type=LOCALIZED_STRING) void setNullSelectionCaption(String nullOption) Sets the null selection caption.The empty string
""is the default null selection caption.If null selection is allowed then the null item will be shown with the given caption.
- Parameters:
nullOption- the caption to set, notnull
-
isTextInputAllowed
boolean isTextInputAllowed()- Returns:
- true if text input allowed
-
setTextInputAllowed
Sets whether it is possible to input text into the field or whether the field area of the component is just used to show what is selected. -
setAutomaticPopupOnFocus
void setAutomaticPopupOnFocus(boolean automaticPopupOnFocus) When enabled popup automatically opens on focus. -
isAutomaticPopupOnFocus
boolean isAutomaticPopupOnFocus()- Returns:
- whether popup is automatically shows on focus.
-
getPageLength
int getPageLength()- Returns:
- the page length of the suggestion popup.
-
setPageLength
Sets the page length for the suggestion popup. Setting the page length to 0 will disable suggestion popup paging (all items visible).- Parameters:
pageLength- the pageLength to set
-
setNullOptionVisible
Sets visibility for first null element in suggestion popup. -
isNullOptionVisible
boolean isNullOptionVisible()- Returns:
- true if first null element is visible.
-
getPopupWidth
Returns the suggestion popup's width as a string. By default this width is set tonull.- Returns:
- explicitly set popup width as size string or null if not set
-
setPopupWidth
Sets the suggestion popup's width as a string. By using relative units (e.g. "50%") it's possible to set the popup's width relative to the LookupField itself.By default this width is set to
nullso that the popup's width can be greater than a component width to fit the content of all displayed items. By setting width to "100%" the popup's width will be equal to the width of the LookupField.- Parameters:
width- the width
-
getOptionsCaptionFilter
- Returns:
- a predicate that tests whether an item with the given caption matches to the given search string.
-
setOptionsCaptionFilter
Sets a predicate that tests whether an item with the given caption matches to the given search string.- Parameters:
filter- a predicate to set
-