Package com.vaadin.flow.server.data
Class DataFetchEndedEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.server.data.AbstractDataFetchEvent
com.vaadin.flow.server.data.DataFetchEndedEvent
- All Implemented Interfaces:
Serializable
Event fired through the
service event bus
once a page of items has been loaded and consumed, or the fetch threw, on the
thread that requested it.
Fired in reverse listener registration order, so that listeners nest around
the matching DataFetchStartedEvent. Because a data provider may
return a lazily evaluated Stream, this is fired
after the returned items have been consumed, so the measured duration covers
the backend round-trip rather than only the call that started it.
- Since:
- 25.3
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionDataFetchEndedEvent(UI ui, Component component, int offset, int limit, boolean filtered, int rowsReturned) Creates a new event. -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of items the data provider actually returned.Methods inherited from class com.vaadin.flow.server.data.AbstractDataFetchEvent
getComponent, getLimit, getOffset, getSource, getUI, isFilteredMethods inherited from class java.util.EventObject
toString
-
Constructor Details
-
DataFetchEndedEvent
public DataFetchEndedEvent(UI ui, Component component, int offset, int limit, boolean filtered, int rowsReturned) Creates a new event.- Parameters:
ui- the UI the fetching component belongs to, notnullcomponent- the component whose data is being fetched, ornullif it could not be resolvedoffset- the index of the first item requestedlimit- the number of items requestedfiltered- whether a filter was set on the queryrowsReturned- the number of items the data provider actually returned, which may be fewer thanAbstractDataFetchEvent.getLimit(), or-1if the fetch threw, in which case aDataFetchFailedEventcarrying the throwable was fired first
-
-
Method Details
-
getRowsReturned
public int getRowsReturned()Gets the number of items the data provider actually returned.- Returns:
- the row count, or
-1if the fetch threw
-