summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-11-30 13:39:28 +0200
committerVaadin Code Review <review@vaadin.com>2015-11-30 12:27:41 +0000
commited3f08b0385fba7a28269cacd3f20c62e303769f (patch)
treee3adb794dc7e72f0c6edbb175b090999d18cde56
parentb021d6199acd666abc729c6c20eaf68b820d1bdb (diff)
downloadvaadin-framework-ed3f08b0385fba7a28269cacd3f20c62e303769f.tar.gz
vaadin-framework-ed3f08b0385fba7a28269cacd3f20c62e303769f.zip
Fix select all checkbox state update with low row count (#19322)
Change-Id: Ifbaeb2db18ecb6657ae839fec90dbfcaa99be4ac
-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 c75013b8c6..e1c7e894a3 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -1862,8 +1862,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
}
private void updateAllSelectedState() {
- if (getState().allSelected != selection.size() >= selectionLimit) {
- getState().allSelected = selection.size() >= selectionLimit;
+ int totalRowCount = getParentGrid().datasource.size();
+ int rows = Math.min(totalRowCount, selectionLimit);
+ if (getState().allSelected != selection.size() >= rows) {
+ getState().allSelected = selection.size() >= rows;
}
}