T - the type of the items in ComboBoxpublic class ComboBoxLazyDataView<T>
extends com.vaadin.flow.data.provider.AbstractLazyDataView<T>
| Constructor and Description |
|---|
ComboBoxLazyDataView(com.vaadin.flow.data.provider.DataCommunicator<T> dataCommunicator,
com.vaadin.flow.component.Component component)
Creates a new lazy data view for ComboBox and verifies the passed data
provider is compatible with this data view implementation.
|
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addItemCountChangeListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.data.provider.ItemCountChangeEvent<?>> listener) |
T |
getItem(int index)
Gets the item at the given index from the data available in the
ComboBox's server-side.
|
Stream<T> |
getItems()
Gets the items available on the ComboBox's server-side.
|
void |
setItemCountCallback(com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback<T,String> callback)
Sets a callback that the combo box uses to get the exact item count in
the backend.
|
void |
setItemCountEstimate(int itemCountEstimate) |
void |
setItemCountFromDataProvider() |
void |
setItemCountUnknown() |
getDataCommunicator, getItemCountEstimate, getItemCountEstimateIncrease, getSupportedDataProviderType, setItemCountEstimateIncreaseequals, getIdentifierProvider, refreshAll, refreshItem, setIdentifierProvider, verifyDataProviderTypepublic ComboBoxLazyDataView(com.vaadin.flow.data.provider.DataCommunicator<T> dataCommunicator, com.vaadin.flow.component.Component component)
dataCommunicator - the data communicator of the componentcomponent - the ComboBoxpublic void setItemCountCallback(com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback<T,String> callback)
The given callback will be queried for the count instead of the data
provider DataProvider.size(Query) method when the component has a
distinct data provider set with
HasLazyDataView.setItems(BackEndDataProvider).
callback - the callback to use for determining item count in the backend,
not nullsetItemCountFromDataProvider(),
setItemCountUnknown()public void setItemCountFromDataProvider()
public void setItemCountEstimate(int itemCountEstimate)
Calling this method will clear any previously set count callback
setItemCountCallback(CallbackDataProvider.CountCallback).
public void setItemCountUnknown()
Calling this method will clear any previously set count callback
setItemCountCallback(CallbackDataProvider.CountCallback).
public com.vaadin.flow.shared.Registration addItemCountChangeListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.data.provider.ItemCountChangeEvent<?>> listener)
Combo box fires ItemCountChangeEvent and notifies all the
listeners added by this method, if the items count changed, for instance,
due to fetching more items while scrolling with unknown item count.
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.
public T getItem(int index)
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.
getItem in interface com.vaadin.flow.data.provider.DataView<T>getItem in class com.vaadin.flow.data.provider.AbstractLazyDataView<T>index - item index numberIndexOutOfBoundsException - requested index is outside of the data setCopyright © 2021. All rights reserved.