diff options
author | cuong-phan <39257573+cuong-phan@users.noreply.github.com> | 2019-05-16 11:53:24 +0300 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2019-05-16 11:53:24 +0300 |
commit | 2b1f9fac342bad3665aa19c07866fa146c90e357 (patch) | |
tree | 3504d2f944aa69aeab36e039ce97569f77300569 /server | |
parent | 07fe51a15eaac560c58eabc969940660c192c134 (diff) | |
download | vaadin-framework-2b1f9fac342bad3665aa19c07866fa146c90e357.tar.gz vaadin-framework-2b1f9fac342bad3665aa19c07866fa146c90e357.zip |
Fix duplicate grid column visibility change event (#11565)
* Fix duplicate grid column visibility change event
Toggle a column visibility through UI will fire 2 event. There should be only 1.
* Add Test
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 3c9116fab3..d463832119 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -697,8 +697,9 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, @Override public void columnVisibilityChanged(String internalId, boolean hidden) { Column<T, ?> column = getColumnByInternalId(internalId); + column.checkColumnIsAttached(); if (column.isHidden() != hidden) { - column.setHidden(hidden); + column.getState().hidden = hidden; fireColumnVisibilityChangeEvent(column, hidden, true); } } |