From 2b1f9fac342bad3665aa19c07866fa146c90e357 Mon Sep 17 00:00:00 2001 From: cuong-phan <39257573+cuong-phan@users.noreply.github.com> Date: Thu, 16 May 2019 11:53:24 +0300 Subject: 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 --- server/src/main/java/com/vaadin/ui/Grid.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server') 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 extends AbstractListing implements HasComponents, @Override public void columnVisibilityChanged(String internalId, boolean hidden) { Column column = getColumnByInternalId(internalId); + column.checkColumnIsAttached(); if (column.isHidden() != hidden) { - column.setHidden(hidden); + column.getState().hidden = hidden; fireColumnVisibilityChangeEvent(column, hidden, true); } } -- cgit v1.2.3