From 3cba005cdbd00b47618fce6b5aa08c19622f400e Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Mon, 28 Apr 2014 17:04:30 +0300 Subject: [PATCH] Fixed update order of column state #13334 Change-Id: I7882027441a5ea0389189fd08c2918e33afe71b6 --- .../com/vaadin/client/ui/grid/GridConnector.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/client/src/com/vaadin/client/ui/grid/GridConnector.java b/client/src/com/vaadin/client/ui/grid/GridConnector.java index e862097009..e55a71cb2e 100644 --- a/client/src/com/vaadin/client/ui/grid/GridConnector.java +++ b/client/src/com/vaadin/client/ui/grid/GridConnector.java @@ -204,11 +204,20 @@ public class GridConnector extends AbstractComponentConnector { private void addColumnFromStateChangeEvent(int columnIndex) { GridColumnState state = getState().columns.get(columnIndex); CustomGridColumn column = new CustomGridColumn(columnIndex); - updateColumnFromState(column, state); - columnIdToColumn.put(state.id, column); + // Adds a column to grid, and registers Grid with the column. getWidget().addColumn(column, columnIndex); + + /* + * Have to update state _after_ the column has been added to the grid as + * then, and only then, the column will call the grid which in turn will + * call the escalator's refreshRow methods on header/footer/body and + * visually refresh the row. If this is done in the reverse order the + * first column state update will be lost as no grid instance is + * present. + */ + updateColumnFromState(column, state); } /** -- 2.39.5