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
Modifier and TypeInterfaceDescriptionstatic class
Caption 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.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasEnterPressHandler
HasEnterPressHandler.EnterPressEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasFilterMode
HasFilterMode.FilterMode
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V>
-
Field Summary
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the suggestion popup's width as a string.boolean
boolean
boolean
static <T> org.springframework.core.ParameterizedTypeReference<ComboBox<T>>
void
setAutomaticPopupOnFocus
(boolean automaticPopupOnFocus) When enabled popup automatically opens on focus.void
setNullOptionVisible
(boolean nullOptionVisible) Sets visibility for first null element in suggestion popup.void
setNullSelectionCaption
(String nullOption) Sets the null selection caption.void
Sets a predicate that tests whether an item with the given caption matches to the given search string.void
setPageLength
(int pageLength) Sets the page length for the suggestion popup.void
setPopupWidth
(String width) Sets the suggestion popup's width as a string.void
setTextInputAllowed
(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, setBuffered
Methods 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, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditable
Methods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasEnterPressHandler
getEnterPressHandler, setEnterPressHandler
Methods inherited from interface io.jmix.ui.component.HasFilterMode
getFilterMode, setFilterMode
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.HasInputPrompt
getInputPrompt, setInputPrompt
Methods inherited from interface io.jmix.ui.component.HasOptionCaptionProvider
getOptionCaptionProvider, setOptionCaptionProvider
Methods inherited from interface io.jmix.ui.component.HasOptionIconProvider
getOptionIconProvider, setOptionIconProvider
Methods inherited from interface io.jmix.ui.component.HasOptionImageProvider
getOptionImageProvider, setOptionImageProvider
Methods inherited from interface io.jmix.ui.component.HasOptionStyleProvider
getOptionStyleProvider, setOptionStyleProvider
Methods inherited from interface io.jmix.ui.component.HasValidator
addValidator, addValidators, getValidators, removeValidator
Methods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
Methods inherited from interface io.jmix.ui.component.data.HasValueSource
getValueSource, setValueSource
Methods inherited from interface io.jmix.ui.component.OptionsField
getOptions, setOptions, setOptionsEnum, setOptionsList, setOptionsMap
Methods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessage
Methods 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
null
so 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
-