T - the type of the items contained by this componentpublic class MultiSelectListBox<T> extends ListBoxBase<MultiSelectListBox<T>,T,Set<T>> implements com.vaadin.flow.data.selection.MultiSelect<MultiSelectListBox<T>,T>
vaadin-list-box element with
multi-selection.ListBox,
Serialized Formcom.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V>| Constructor and Description |
|---|
MultiSelectListBox()
Creates a new list box component with multi-selection.
|
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addSelectionListener(com.vaadin.flow.data.selection.MultiSelectionListener<MultiSelectListBox<T>,T> listener) |
Set<T> |
getSelectedItems()
Returns an immutable set of the currently selected items.
|
void |
setValue(Set<T> value)
Sets the value of this component.
|
void |
updateSelection(Set<T> addedItems,
Set<T> removedItems) |
getDataProvider, getItemEnabledProvider, getItemRenderer, onAttach, onDetach, onEnabledStateChanged, setDataProvider, setItemEnabledProvider, setRenderer, setRequiredIndicatorVisiblegetSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventaddValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, valueEqualsaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeselect, deselect, deselectAll, getEmptyValue, getValue, isSelected, select, selectisReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisibleaddValueChangeListener, clear, getOptionalValue, isEmptyaddComponents, getItemPosition, prependComponentsadd, add, addComponentAsFirst, addComponentAtIndex, remove, removeAllgetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullpublic MultiSelectListBox()
public void setValue(Set<T> value)
The component doesn't accept null values. The value of multi
select list box without any selected items is an empty set. You can use
the HasValue.clear() method to set the empty value.
setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<MultiSelectListBox<T>,Set<T>>,Set<T>>setValue in interface com.vaadin.flow.data.selection.MultiSelect<MultiSelectListBox<T>,T>setValue in class com.vaadin.flow.component.AbstractField<MultiSelectListBox<T>,Set<T>>value - the new value to set, not nullNullPointerException - if value is nullpublic void updateSelection(Set<T> addedItems, Set<T> removedItems)
updateSelection in interface com.vaadin.flow.data.selection.MultiSelect<MultiSelectListBox<T>,T>public Set<T> getSelectedItems()
SelectionModel methods while iterating over the set.
There are no guarantees of the iteration order of the returned set of items.
getSelectedItems in interface com.vaadin.flow.data.selection.MultiSelect<MultiSelectListBox<T>,T>nullpublic com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.data.selection.MultiSelectionListener<MultiSelectListBox<T>,T> listener)
addSelectionListener in interface com.vaadin.flow.data.selection.MultiSelect<MultiSelectListBox<T>,T>Copyright © 2025. All rights reserved.