Class ComboBoxDataView<T>
- Type Parameters:
T- the item type
- All Implemented Interfaces:
com.vaadin.flow.data.provider.DataView<T>,Serializable
ListDataProvider or BackEndDataProvider.- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.data.provider.AbstractDataView
component, dataProviderSupplier, NULL_IDENTIFIER_ERROR_MESSAGE, NULL_ITEM_ERROR_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionComboBoxDataView(com.vaadin.flow.data.provider.DataCommunicator<T> dataCommunicator, ComboBoxBase<?, T, ?> comboBox) Creates a new generic data view for ComboBox and verifies the passed data provider is compatible with this data view implementation. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddItemCountChangeListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.data.provider.ItemCountChangeEvent<?>> listener) getItem(int index) Gets the item at the given index from the data available in the ComboBox's server-side.getItems()Gets the items available on the ComboBox's server-side.protected Class<?>voidsetIdentifierProvider(com.vaadin.flow.data.provider.IdentifierProvider<T> identifierProvider) Methods inherited from class com.vaadin.flow.data.provider.AbstractDataView
addIdentifierProviderChangeListener, equals, getIdentifierProvider, getItemIndex, getItemIndex, refreshAll, refreshItem, verifyDataProviderType, verifyDataProviderType
-
Constructor Details
-
ComboBoxDataView
public ComboBoxDataView(com.vaadin.flow.data.provider.DataCommunicator<T> dataCommunicator, ComboBoxBase<?, T, ?> comboBox) Creates a new generic data view for ComboBox and verifies the passed data provider is compatible with this data view implementation.- Parameters:
dataCommunicator- the data communicator of the componentcomboBox- the ComboBox
-
-
Method Details
-
getItem
Gets the item at the given index from the data available in the ComboBox's server-side.This method does not take into account the ComboBox client-side filtering, since it doesn't change the item count on the server-side, but only makes it easier for users to search through the items in the UI.
- Parameters:
index- item index number- Returns:
- item on index
- Throws:
IndexOutOfBoundsException- requested index is outside of the data set
-
getSupportedDataProviderType
- Specified by:
getSupportedDataProviderTypein classcom.vaadin.flow.data.provider.AbstractDataView<T>
-
getItems
Gets the items available on the ComboBox's server-side.This method does not take into account the ComboBox client-side filtering, since it doesn't change the item count on the server-side, but only makes it easier for users to search through the items in the UI.
-
setIdentifierProvider
public void setIdentifierProvider(com.vaadin.flow.data.provider.IdentifierProvider<T> identifierProvider) -
addItemCountChangeListener
public com.vaadin.flow.shared.Registration addItemCountChangeListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.data.provider.ItemCountChangeEvent<?>> listener) Combo box fires
ItemCountChangeEventand notifies all the listeners added by this method, if the items count changed, for instance, due to adding or removing an item(s).ComboBox's client-side filter change won't fire
ItemCountChangeEvent, since it doesn't change the item count on the server-side, but only makes it easier for users to search through the items in the UI.
-