diff options
author | Henrik Paul <henrik@vaadin.com> | 2014-09-02 13:15:21 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2014-09-09 10:35:41 +0000 |
commit | eba0c3dd709f60a123860a609a50daa5558588d4 (patch) | |
tree | 20efac5e3151b14638015c2592cb3d41382cd40d /client | |
parent | 224d2f5fe7af5ec235047357129eb99bdaa17bd5 (diff) | |
download | vaadin-framework-eba0c3dd709f60a123860a609a50daa5558588d4.tar.gz vaadin-framework-eba0c3dd709f60a123860a609a50daa5558588d4.zip |
Fixes exception while hiding the last Grid column (#13334)
Change-Id: Icdb8b9609c005a8d59a8c6f3c75523790bb65348
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/grid/Grid.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/grid/Grid.java b/client/src/com/vaadin/client/ui/grid/Grid.java index cd9b615c4b..2b0bbc9f05 100644 --- a/client/src/com/vaadin/client/ui/grid/Grid.java +++ b/client/src/com/vaadin/client/ui/grid/Grid.java @@ -883,7 +883,17 @@ public class Grid<T> extends Composite implements return; } - this.visible = visible; + /* + * We need to guarantee that both insertColumns and removeColumns + * have this particular column accessible. Therefore, if we're + * turning the column visible, it's set before the other logic. + * Analogously, if we're turning the column invisible, we do that + * only after the logic has been performed. + */ + + if (visible) { + this.visible = true; + } if (grid != null) { int index = findIndexOfColumn(); @@ -895,7 +905,13 @@ public class Grid<T> extends Composite implements } else { conf.removeColumns(index, 1); } + } + if (!visible) { + this.visible = false; + } + + if (grid != null) { for (HeaderRow row : grid.getHeader().getRows()) { row.calculateColspans(); } |