V
- type of options and value@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%/backoffice-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
Modifier and Type | Interface and Description |
---|---|
static class |
ComboBox.OptionsCaptionFilteringContext
Caption filtering context.
|
HasValue.ValueChangeEvent<V>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
HasFilterMode.FilterMode
HasEnterPressHandler.EnterPressEvent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
static org.springframework.core.ParameterizedTypeReference<ComboBox<java.lang.String>> |
TYPE_STRING |
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNullSelectionCaption() |
java.util.function.Predicate<ComboBox.OptionsCaptionFilteringContext> |
getOptionsCaptionFilter() |
int |
getPageLength() |
java.lang.String |
getPopupWidth()
Returns the suggestion popup's width as a string.
|
boolean |
isAutomaticPopupOnFocus() |
boolean |
isNullOptionVisible() |
boolean |
isTextInputAllowed() |
static <T> org.springframework.core.ParameterizedTypeReference<ComboBox<T>> |
of(java.lang.Class<T> valueClass) |
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(java.lang.String nullOption)
Sets the null selection caption.
|
void |
setOptionsCaptionFilter(java.util.function.Predicate<ComboBox.OptionsCaptionFilteringContext> filter)
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(java.lang.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.
|
getOptions, setOptions, setOptionsEnum, setOptionsList, setOptionsMap
getValueSource, setValueSource
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
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
isValid, isValidateOnCommit, validate
getIcon, setIcon, setIconFromSet
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
addValidator, addValidators, getValidators, removeValidator
getRequiredMessage, isRequired, setRequired, setRequiredMessage
getOptionCaptionProvider, setOptionCaptionProvider
getInputPrompt, setInputPrompt
commit, discard, isBuffered, isModified, setBuffered
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
getOptionStyleProvider, setOptionStyleProvider
getOptionIconProvider, setOptionIconProvider
getOptionImageProvider, setOptionImageProvider
getFilterMode, setFilterMode
getEnterPressHandler, setEnterPressHandler
static final java.lang.String NAME
static final org.springframework.core.ParameterizedTypeReference<ComboBox<java.lang.String>> TYPE_STRING
static <T> org.springframework.core.ParameterizedTypeReference<ComboBox<T>> of(java.lang.Class<T> valueClass)
java.lang.String getNullSelectionCaption()
null
@StudioProperty(name="nullName", type=LOCALIZED_STRING) void setNullSelectionCaption(java.lang.String nullOption)
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.
nullOption
- the caption to set, not null
boolean isTextInputAllowed()
@StudioProperty(defaultValue="true") void setTextInputAllowed(boolean textInputAllowed)
void setAutomaticPopupOnFocus(boolean automaticPopupOnFocus)
boolean isAutomaticPopupOnFocus()
int getPageLength()
@StudioProperty(defaultValue="10") @PositiveOrZero void setPageLength(int pageLength)
pageLength
- the pageLength to set@StudioProperty(defaultValue="true") void setNullOptionVisible(boolean nullOptionVisible)
boolean isNullOptionVisible()
@Nullable java.lang.String getPopupWidth()
null
.void setPopupWidth(@Nullable java.lang.String width)
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.
width
- the width@Nullable java.util.function.Predicate<ComboBox.OptionsCaptionFilteringContext> getOptionsCaptionFilter()
void setOptionsCaptionFilter(@Nullable java.util.function.Predicate<ComboBox.OptionsCaptionFilteringContext> filter)
filter
- a predicate to set