Package com.vaadin.featurepack.ui
Class FComboBox
java.lang.Object
- All Implemented Interfaces:
Buffered,BufferedValidatable,Container,Container.ItemSetChangeListener,Container.ItemSetChangeNotifier,Container.PropertySetChangeListener,Container.PropertySetChangeNotifier,Container.Viewer,Property<Object>,Property.Editor,Property.ReadOnlyStatusChangeListener,Property.ReadOnlyStatusChangeNotifier,Property.ValueChangeListener,Property.ValueChangeNotifier,Property.Viewer,Field<Object>,Select,Validatable,FieldEvents.BlurNotifier,FieldEvents.FocusNotifier,ClientConnector,FAbstractClientConnector,FSizeable,HasSizeable,FAbstractComponent,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.combobox.ComboBox<Object>>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.combobox.ComboBox<Object>>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.combobox.ComboBox<Object>>,com.vaadin.flow.component.HasAriaDescription,com.vaadin.flow.component.HasAriaLabel,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasPlaceholder,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.combobox.ComboBox<Object>,,Object>, Object> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.combobox.ComboBox<Object>,,Object>, Object> com.vaadin.flow.component.shared.HasAllowedCharPattern,com.vaadin.flow.component.shared.HasAutoOpen,com.vaadin.flow.component.shared.HasClearButton,com.vaadin.flow.component.shared.HasPrefix,com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.combobox.ComboBoxVariant>,com.vaadin.flow.component.shared.HasTooltip,com.vaadin.flow.component.shared.HasValidationProperties,com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.combobox.ComboBox<Object>,,Object>, Object> com.vaadin.flow.data.binder.HasValidator<Object>,com.vaadin.flow.data.provider.HasDataView<Object,,String, com.vaadin.flow.component.combobox.dataview.ComboBoxDataView<Object>> com.vaadin.flow.data.provider.HasLazyDataView<Object,,String, com.vaadin.flow.component.combobox.dataview.ComboBoxLazyDataView<Object>> com.vaadin.flow.data.provider.HasListDataView<Object,,com.vaadin.flow.component.combobox.dataview.ComboBoxListDataView<Object>> Serializable
public class FComboBox
extends com.vaadin.flow.component.combobox.ComboBox<Object>
implements Select, FAbstractComponent, FieldEvents.FocusNotifier, FieldEvents.BlurNotifier, HasSizeable
A Flow component that wraps a
ComboBox and implements v7
functionalities that the Flow counterpart does not possess.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.combobox.ComboBox
com.vaadin.flow.component.combobox.ComboBox.ComboBoxI18n, com.vaadin.flow.component.combobox.ComboBox.FetchItemsCallback<T>, com.vaadin.flow.component.combobox.ComboBox.ItemFilter<T>Nested classes/interfaces inherited from class com.vaadin.flow.component.combobox.ComboBoxBase
com.vaadin.flow.component.combobox.ComboBoxBase.CustomValueSetEvent<TComponent extends com.vaadin.flow.component.combobox.ComboBoxBase<TComponent,?, ?>>, com.vaadin.flow.component.combobox.ComboBoxBase.SpringData Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Buffered
Buffered.SourceExceptionNested classes/interfaces inherited from interface com.vaadin.featurepack.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.featurepack.data.Container
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.ViewerNested classes/interfaces inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
FAbstractClientConnector.LegacyMethodEventNested classes/interfaces inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
FAbstractComponent.DataKeyNested classes/interfaces inherited from interface com.vaadin.featurepack.data.ui.Field
Field.ValueChangeEventNested classes/interfaces inherited from interface com.vaadin.flow.component.Focusable
com.vaadin.flow.component.Focusable.FocusJsNested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an emptyFComboBox.Constructs an emptyFComboBoxwith the provided caption.Constructs a newFComboBoxwith the provided caption and data source.FComboBox(String caption, Collection<?> options) Constructs a newFComboBoxwith the provided caption and options. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds given items with given item ids to container.voidaddItems(Collection<?> itemIds) Adds given items with given item ids to container.protected voidfireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent) Gets the current filtering mode.Gets the item caption mode.Gets the currently used item style generator.Returns the new item handler, which is called when user adds new item innewItemAllowedmode.intReturns the page length of the suggestion popup.Returns the suggestion pop-up's width as a CSS string, ornullif not set.Class<?> getType()Returns the type of the Property.getValue()Gets the value stored in the Property.booleanbooleanReturns true if the select should find the page with the selected item when opening the popup (single select combo box only).booleanReturns true if the user can enter text into the field to either filter the selections or enter a new value ifSelect.isNewItemsAllowed()returns true.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) protected voidvoidsetFilteringMode(FilteringMode filteringMode) Sets the option filtering mode.voidsetItemCaption(Object itemId, String caption) Override the caption of an item.voidSets the item caption mode.voidsetItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<Object> itemLabelGenerator) voidsetItemStyleGenerator(ItemStyleGenerator itemStyleGenerator) Sets the item style generator that is used to produce custom styles for showing items in the popup.voidvoidsetLabelComponent(com.vaadin.flow.component.Component labelComponent) Sets the component's label component.voidsetMultiSelect(boolean multiSelect) voidsetNewItemHandler(FAbstractSelect.NewItemHandler newItemHandler) Sets the new item handler.voidsetNullSelectionAllowed(boolean nullSelectionAllowed) voidsetNullSelectionItemId(Object nullSelectionItemId) Sets the item id that represents null value of this select.voidsetPageLength(int pageLength) Sets the page length for the suggestion popup.voidsetPopupWidth(String popupWidth) Sets the suggestion pop-up's width as a CSS string.voidsetRequired(boolean required) Sets the field required.voidsetScrollToSelectedItem(boolean scrollToSelectedItem) Sets whether to scroll the selected item visible (directly open the page on which it is) when opening the combo box popup or not.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.voidSets the value of the Property.voidvalidate()Checks the validity of the validatable.Methods inherited from class com.vaadin.flow.component.combobox.ComboBox
getEmptyValue, getI18n, getPattern, isFocusSelectedItem, isSelected, setFocusSelectedItem, setI18n, setOverlayWidth, setOverlayWidth, setPattern, setRequiredIndicatorVisibleMethods inherited from class com.vaadin.flow.component.combobox.ComboBoxBase
addCustomValueSetListener, generateClassName, generateLabel, getAriaDescribedBy, getAriaLabel, getAriaLabelledBy, getDataCommunicator, getDataController, getDataGenerator, getDataProvider, getDefaultValidator, getFilter, getFilterTimeout, getGenericDataView, getItemClassNameGenerator, getItemLabelGenerator, getKeyMapper, getLazyDataView, getListDataView, getPageSize, getPartialMatchMode, getRenderManager, isAllowCustomValue, isAutofocus, isOpened, isRequired, isRequiredIndicatorVisible, runBeforeClientResponse, setAllowCustomValue, setAriaDescribedBy, setAriaLabel, setAriaLabelledBy, setAutofocus, setClassNameGenerator, setDataProvider, setDataProvider, setFilter, setFilterTimeout, setI18n, setItems, setItems, setItems, setItems, setItems, setItems, setItems, setItems, setItems, setItems, setItems, setItemsPageable, setItemsPageable, setItemsWithFilterConverter, setItemsWithFilterConverter, setManualValidation, setOpened, setPageSize, setPartialMatchMode, setRendererMethods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, bindValue, isEmpty, setModelValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, findAncestor, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
addLegacyAttachListener, addLegacyDetachListener, addListener, addListener, attach, detach, doConnectorOnAttach, doConnectorOnDetach, fireEvent, fireEvent, getAllChildrenIterable, getFListeners, getFlowComponent, getResource, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeListener, removeListener, setResourceMethods inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, addStyleNames, beforeClientResponse, getCaption, getComponentError, getData, getDescription, getFErrorIndicator, getFErrorMessage, getFId, getFParent, getIcon, getIconResource, getPrimaryStyleName, getStyleName, isCaptionAsHtml, isImmediate, isResponsive, notifyParentAboutStyleChanges, removeContextClickListener, removeShortcutListener, removeStyleName, removeStyleNames, setCaption, setCaptionAsHtml, setComponentError, setData, setDescription, setDescription, setIcon, setIcon, setIconResource, setImmediate, setLocale, setPrimaryStyleName, setResponsive, setStyleName, setStyleNameMethods inherited from interface com.vaadin.featurepack.data.ui.Field
addValidator, addValueChangeListener, commit, discard, getConvertedValue, getConverter, getFAbstractField, getPropertyDataSource, getRequiredError, getValidators, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isPropertyReadOnly, isRequired, isValid, removeAllValidators, removeValidator, removeValueChangeListener, setBuffered, setConverter, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setPropertyReadOnly, setRequiredError, valueChangeMethods inherited from interface com.vaadin.featurepack.event.FieldEvents.BlurNotifier
addBlurListener, removeBlurListenerMethods inherited from interface com.vaadin.featurepack.event.FieldEvents.FocusNotifier
addFocusListener, removeFocusListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.shared.HasAllowedCharPattern
getAllowedCharPattern, setAllowedCharPatternMethods inherited from interface com.vaadin.flow.component.HasAriaDescription
setAriaDescribedByMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
setAriaLabelledByMethods inherited from interface com.vaadin.flow.component.shared.HasAutoOpen
isAutoOpen, setAutoOpenMethods inherited from interface com.vaadin.flow.component.shared.HasClearButton
bindClearButtonVisible, isClearButtonVisible, setClearButtonVisibleMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
bindHelperText, getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasLabel
getLabelMethods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItemsMethods inherited from interface com.vaadin.flow.component.HasPlaceholder
bindPlaceholder, getPlaceholder, setPlaceholderMethods inherited from interface com.vaadin.flow.component.shared.HasPrefix
getPrefixComponent, setPrefixComponentMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.featurepack.server.HasSizeable
getFHeight, getFWidth, getHeightUnits, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefinedMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipMarkdown, setTooltipTextMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.data.binder.HasValidator
addValidationStatusChangeListenerMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, bindValue, clear, getOptionalValue, isEmptyMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
bindReadOnly, bindRequiredIndicatorVisible, isReadOnly, setReadOnlyMethods inherited from interface com.vaadin.featurepack.data.ui.Select
addContainerProperty, addItem, addItem, addItemSetChangeListener, addPropertySetChangeListener, addReadOnlyStatusChangeListener, containerItemSetChange, containerPropertySetChange, containsId, getContainerDataSource, getContainerProperty, getContainerPropertyIds, getFAbstractSelect, getItem, getItemCaption, getItemCaptionPropertyId, getItemIcon, getItemIconPropertyId, getItemIdByItem, getItemIds, getNullSelectionItemId, getType, isNewItemsAllowed, isNullSelectionAllowed, readOnlyStatusChange, removeAllItems, removeContainerProperty, removeItem, removeItemSetChangeListener, removePropertySetChangeListener, removeReadOnlyStatusChangeListener, select, setContainerDataSource, setItemCaptionPropertyId, setItemIcon, setItemIconPropertyId, setNewItemsAllowed, size
-
Constructor Details
-
FComboBox
public FComboBox()Constructs an emptyFComboBox. -
FComboBox
Constructs an emptyFComboBoxwith the provided caption.- Parameters:
caption- the caption to set
-
FComboBox
Constructs a newFComboBoxwith the provided caption and options.- Parameters:
caption- the caption to setoptions- the options to set
-
FComboBox
Constructs a newFComboBoxwith the provided caption and data source.- Parameters:
caption- the caption to setdataSource- the data source to set
-
-
Method Details
-
fireEvent
protected void fireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent) - Overrides:
fireEventin classcom.vaadin.flow.component.Component
-
setValue
Description copied from interface:PropertySets the value of the Property.Implementing this functionality is optional. If the functionality is missing, one should declare the Property to be in read-only mode and throw
Note : Since Vaadin 7.0, setting the value of a non-String property as a String is no longer supported.Property.ReadOnlyExceptionin this function.- Specified by:
setValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.combobox.ComboBox<Object>,Object>, Object> - Specified by:
setValuein interfaceProperty<Object>- Specified by:
setValuein interfaceSelect- Overrides:
setValuein classcom.vaadin.flow.component.combobox.ComboBoxBase<com.vaadin.flow.component.combobox.ComboBox<Object>,Object, Object> - Parameters:
value- New value of the Property. This should be assignable to the type returned by getType
-
getValue
Description copied from interface:PropertyGets the value stored in the Property. The returned object is compatible with the class returned by getType().- Specified by:
getValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.combobox.ComboBox<Object>,Object>, Object> - Specified by:
getValuein interfaceProperty<Object>- Specified by:
getValuein interfaceSelect- Overrides:
getValuein classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.combobox.ComboBox<Object>,Object> - Returns:
- the value stored in the Property
-
setTextInputAllowed
public 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. By disabling text input, the comboBox will work in the same way as a select.- Parameters:
textInputAllowed- true to allow entering text, false to just show the current selection- See Also:
-
isTextInputAllowed
public boolean isTextInputAllowed()Returns true if the user can enter text into the field to either filter the selections or enter a new value ifSelect.isNewItemsAllowed()returns true. If text input is disabled, the combo box will work in the same way as a select. -
setScrollToSelectedItem
public void setScrollToSelectedItem(boolean scrollToSelectedItem) Sets whether to scroll the selected item visible (directly open the page on which it is) when opening the combo box popup or not. Only applies to single select mode. This requires finding the index of the item, which can be expensive in many large lazy loading containers.- Parameters:
scrollToSelectedItem- true to find the page with the selected item when opening the selection popup
-
isScrollToSelectedItem
public boolean isScrollToSelectedItem()Returns true if the select should find the page with the selected item when opening the popup (single select combo box only).- Returns:
- true if the page with the selected item will be shown when opening the popup
- See Also:
-
setPageLength
public void setPageLength(int pageLength) 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 page length to set- See Also:
-
getPageLength
public int getPageLength()Returns the page length of the suggestion popup. A value of 0 disables paging.- Returns:
- current page length
- See Also:
-
setPopupWidth
Sets the suggestion pop-up's width as a CSS string. By using relative units (e.g. "50%") it's possible to set the popup's width relative to the ComboBox itself.- Parameters:
popupWidth- the new width for the popup, ornullto let it size automatically- See Also:
-
getPopupWidth
Returns the suggestion pop-up's width as a CSS string, ornullif not set.- Returns:
- the current popup width, or
null - See Also:
-
setItemLabelGenerator
public void setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<Object> itemLabelGenerator) -
getFilteringMode
Gets the current filtering mode.- Returns:
- the filtering mode in use
-
getItemStyleGenerator
Gets the currently used item style generator.- Returns:
- the itemStyleGenerator the currently used item style generator,
or
nullif no generator is used - Since:
- 7.5.6
-
setNullSelectionAllowed
public void setNullSelectionAllowed(boolean nullSelectionAllowed) - Specified by:
setNullSelectionAllowedin interfaceSelect
-
setNullSelectionItemId
Sets the item id that represents null value of this select.Data interface does not support nulls as item ids. Selecting the item identified by this id is the same as selecting no items at all. This setting only affects the single select mode.
- Specified by:
setNullSelectionItemIdin interfaceSelect- Parameters:
nullSelectionItemId- the nullSelectionItemId to set.- See Also:
-
setLabel
- Specified by:
setLabelin interfacecom.vaadin.flow.component.HasLabel
-
setLabelComponent
public void setLabelComponent(com.vaadin.flow.component.Component labelComponent) Description copied from interface:FAbstractComponentSets the component's label component. Flow components that support caption component usually overrides this.- Specified by:
setLabelComponentin interfaceFAbstractComponent- Parameters:
labelComponent- the new label component for the component.
-
setMultiSelect
public void setMultiSelect(boolean multiSelect) - Specified by:
setMultiSelectin interfaceSelect
-
isMultiSelect
public boolean isMultiSelect()- Specified by:
isMultiSelectin interfaceSelect
-
validate
public void validate()Description copied from interface:ValidatableChecks the validity of the validatable. If the validatable is valid this method should do nothing, and if it's not valid, it should throw
Validator.InvalidValueException -
addItems
Adds given items with given item ids to container.- Parameters:
itemIds- item identifiers to be added to underlying container- Throws:
UnsupportedOperationException- if the underlying container don't support adding items with identifiers- Since:
- 7.2
-
addItems
Adds given items with given item ids to container.- Parameters:
itemIds- item identifiers to be added to underlying container- Throws:
UnsupportedOperationException- if the underlying container don't support adding items with identifiers- Since:
- 7.2
-
setItemCaption
Override the caption of an item. Setting caption explicitly overrides id, item and index captions.- Parameters:
itemId- the id of the item to be recaptioned.caption- the New caption.
-
setItemCaptionMode
Sets the item caption mode. SeeFAbstractSelect.ItemCaptionModefor a description of the modes.FAbstractSelect.ItemCaptionMode.EXPLICIT_DEFAULTS_IDis the default mode.- Specified by:
setItemCaptionModein interfaceSelect- Parameters:
mode- the One of the modes listed above.
-
getItemCaptionMode
Gets the item caption mode.The mode can be one of the following ones:
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID: Items Id-objectstoStringis used as item caption. If caption is explicitly specified, it overrides the id-caption.ITEM_CAPTION_MODE_ID: Items Id-objectstoStringis used as item caption.ITEM_CAPTION_MODE_ITEM: Item-objectstoStringis used as item caption.ITEM_CAPTION_MODE_INDEX: The index of the item is used as item caption. The index mode can only be used with the containers implementingContainer.Indexedinterface.ITEM_CAPTION_MODE_EXPLICIT: The item captions must be explicitly specified.ITEM_CAPTION_MODE_PROPERTY: The item captions are read from property, that must be specified withsetItemCaptionPropertyId.
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_IDis the default mode.- Specified by:
getItemCaptionModein interfaceSelect- Returns:
- the One of the modes listed above.
-
setNewItemHandler
Sets the new item handler. Called when a new item is added innewItemAllowedmode.- Parameters:
newItemHandler- The new item handler
-
getNewItemHandler
Returns the new item handler, which is called when user adds new item innewItemAllowedmode.- Returns:
- NewItemHandler
-
getType
Description copied from interface:PropertyReturns the type of the Property. The methodsgetValueandsetValuemust be compatible with this type: one must be able to safely cast the value returned fromgetValueto the given type and pass any variable assignable to this type as an argument tosetValue. -
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) -
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) -
setRequired
public void setRequired(boolean required) Description copied from interface:FieldSets the field required. Required fields must filled by the user. -
refreshValue
protected void refreshValue()- Overrides:
refreshValuein classcom.vaadin.flow.component.combobox.ComboBox<Object>
-