summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}
}