T - the event source typepublic class ItemCountChangeEvent<T extends Component> extends ComponentEvent<T>
ItemCountChangeEvent will fired during the "before client
response"-phase, so changes done during the server round trip will only
receive one event. For example, this code will trigger only one event,
although there are two methods called which cause the item count change:
dataView.addItemCountChangeListener(listener);
dataView.addItem(newItem);
dataView.setFilter(filter);
source| Constructor and Description |
|---|
ItemCountChangeEvent(T source,
int itemCount,
boolean itemCountEstimated)
Creates a new event using the given source and indicator whether the
event originated from the client side or the server side.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getItemCount()
Get the new item count for the component.
|
boolean |
isItemCountEstimated()
Returns whether the item count
getItemCount() is an estimate or
the exact count. |
getSource, isFromClient, unregisterListenertoStringpublic ItemCountChangeEvent(T source, int itemCount, boolean itemCountEstimated)
source - the source componentitemCount - new items countitemCountEstimated - whether item count is an estimatepublic int getItemCount()
public boolean isItemCountEstimated()
getItemCount() is an estimate or
the exact count. An estimate is used when items are fetched lazily from
the backend and the count callback has not been provided. See further
details from LazyDataView.setItemCountEstimate(int).
NOTE: this only applies for components that do lazy loading from
the backend and implement HasLazyDataView.
true when the count is an estimate, false when
the count is exactCopyright © 2021. All rights reserved.