diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-09-06 15:34:12 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-09-07 05:54:52 +0000 |
commit | 400818bff226f60e37ee30ed3a0ffe7e845dcf67 (patch) | |
tree | 4425e49236446dae613ad0c12dbf3e0a5c4af050 /client | |
parent | 3d3f12d92bb840a66ed6caaf992e0fe7bb3c1e77 (diff) | |
download | vaadin-framework-400818bff226f60e37ee30ed3a0ffe7e845dcf67.tar.gz vaadin-framework-400818bff226f60e37ee30ed3a0ffe7e845dcf67.zip |
Fix empty data source client-side events
Change-Id: I7e84fd01cf2ec46b18af960712226a48f600f623
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java index 9cc32998b2..33f96e009c 100644 --- a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java +++ b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java @@ -287,7 +287,14 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { dropFromCache(cached); cached = Range.between(0, 0); - handleMissingRows(getMaxCacheRange()); + Range maxCacheRange = getMaxCacheRange(); + if (!maxCacheRange.isEmpty()) { + handleMissingRows(maxCacheRange); + } else { + // There is nothing to fetch. We're done here. + getHandlers().forEach(dch -> dch + .dataAvailable(cached.getStart(), cached.length())); + } } else { discardStaleCacheEntries(); |