Save grid items to db

I have an issue that I really can’t wrap my head around. I have a grid that is editable. When I edit an item and click “Save”, I see the changes in the grid, so far so good. I have a button below the grid, whose purpose is to save the grid items to my db (Mongo DB).
the code of the button click is:

List<Contact> contacts = (List<Contact>) grid.getContainerDataSource().getItemIds(); prospect.setContacts(contacts);; The save to the repository is no problem. The problem occurs on line 1. When debuging and evaluating the first row, I notice that the itemIds returned from the ContainerDataSource is not coherent with the data shown on the grid, the editing made on the items have been ignored or something. The values after editing is not present when retrieving the itemIds from the ContainerDataSource. In the Book of Vaadin I read this:

“​The editor has a Save button that commits the data item to the container data source and closes the editor.”

Shouldn’t this work? What am I missunderstanding?

Please help!



I think the problem corresponds with the bug
and my question in the forum:!/thread/9683271

I am now working on a solution for me.