aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-11-30 13:39:28 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-11-30 14:38:54 +0200
commitb1b63bfb313d799cf947debc4ce23d40edd58bf4 (patch)
tree431f844772e8191e312f4e9d1cf46aae0d85d07b
parent3cf15b139605854c9441f603bdb788b2f5e916e6 (diff)
downloadvaadin-framework-b1b63bfb313d799cf947debc4ce23d40edd58bf4.tar.gz
vaadin-framework-b1b63bfb313d799cf947debc4ce23d40edd58bf4.zip
Fix select all checkbox state update with low row count (#19322)
Change-Id: Ic4fd495a2990f7aa6ed09acd773149d3f13802f8
-rw-r--r--server/src/com/vaadin/ui/Grid.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index d9ac9a4019..99dc21c4b2 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -1284,8 +1284,10 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
}
private void updateAllSelectedState() {
- if (allSelected != selection.size() >= selectionLimit) {
- allSelected = selection.size() >= selectionLimit;
+ int totalRowCount = grid.datasource.size();
+ int rows = Math.min(totalRowCount, selectionLimit);
+ if (allSelected != selection.size() >= rows) {
+ allSelected = selection.size() >= rows;
grid.getRpcProxy(GridClientRpc.class).setSelectAll(allSelected);
}
}