]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for Grid client-side exception. (#10166)
authorPiotr Wilkin <piotr.wilkin@syndatis.com>
Wed, 11 Oct 2017 07:23:22 +0000 (09:23 +0200)
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>
Mon, 23 Oct 2017 09:34:49 +0000 (12:34 +0300)
Do not try to update the select all checkbox if it is not visible.

Fixes #10164

client/src/main/java/com/vaadin/client/widgets/Grid.java

index dd9353155e0adcd86bf94d097bdcc818dd2c0144..3cd9b1b76c2a9a0b35b40f85cb8c950f00336d21 100755 (executable)
@@ -1676,9 +1676,12 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
             if (grid.selectionColumn != null && grid.selectionColumn
                     .getRenderer() instanceof MultiSelectionRenderer) {
                 grid.refreshBody();
-                CheckBox checkBox = (CheckBox) grid.getDefaultHeaderRow()
+                HeaderCell cell = grid.getDefaultHeaderRow().getCell(grid.selectionColumn);
+                if (cell.getType() == GridStaticCellType.WIDGET) { // if lazy provider, then no checkbox
+                    CheckBox checkBox = (CheckBox) grid.getDefaultHeaderRow()
                         .getCell(grid.selectionColumn).getWidget();
-                checkBox.setEnabled(isEnabled);
+                    checkBox.setEnabled(isEnabled);
+                }
             }
         }