vaadin / flow-components

Java counterpart of Vaadin Web Components
101 stars 66 forks source link

Removing column does not clear the client-side state #1201

Open kasprzakpawel opened 4 years ago

kasprzakpawel commented 4 years ago

After the column is removed using the grid.removeColumn() method, some garbage remains on the client side which affects server-side errors e.g. while sorting (especially in multi sort vaadin/vaadin-grid-flow#813).

In this situation, the event listener on the grid component (sortersChanged method) gets data in JSON also from the removed columns (which were sorted), as a consequence the exception

"Received a sorters changed call from the client for a non-existent column"

is thrown.

Details:

finaris-cs commented 1 year ago

This is still an issue with Vaadin 24. In my case removing columns with removeAllColumns() is also affected. sortOrder property in the server side grid instance is empty as expected, but sortersChanged() from client recieves JsonArray sorters referring to columns that do not exist anymore.

Any chance this could be fixed? For now, the only workaround I could find is to ignore that error using a custom error handler for the session...