How can You refresh a vaadin grid after data change
Asked Answered
K

2

1

How can You refresh a grid, when some new row was added to its datasoruce container or one of its rows has been edited?

I have tried the hacks written about here (http://www.helpsforcoder.com/code/31861375-vaadin-refresh-grid-after-row-modification.html ) and here (deleted link to malicious advertisement) but with no positive result. I add / edit the row in a separate subwindow that 'pop-ups' over the view, where the grid, that should update its contents, is placed.

Kellykellyann answered 28/8, 2015 at 16:44 Comment(4)
Please cite from the real StackOverflow.com. Both of your citations appear to be from sites that clone questions and answers from StackOverflow.com. The second one is a spammer that displays an repeating loops of lies saying iOS has crashed.Affiance
Your Question is not clear. Please describe exactly what you are doing. Show code for simplest possible example. Have you worked through examples in The Book Of Vaadin?Affiance
possible duplicate of Update Grid with a fresh set of data, in Vaadin 7.4 appLegitimatize
Sorry Supamiu, but the solutions proposed in #29205174 don't work. The link to them was in my original post but had been removed from it for some strange reason. I had googled and searched beforehand and tried out some things, none of them really working. So this is definitelly not a duplicate question, even though it might seem so. But as the solution from the link does not work, it is not a solution for me.Kellykellyann
R
1

grid.getDataProvider().refreshAll();

Roxana answered 27/11, 2017 at 8:11 Comment(0)
T
0

Grid listens to changed property values. So if you are working on the property level of vaadin everything should be fine. If you extract your bean out of the BeanItemContainer you directly manipulate the values of the bean. That way the property container can not recognize your manipluating action.

So you have to send your grid implementation a message, the properties have changed manually. When your BeanItemContainer still has the hard reference to the changed object, grid.markAsDirty() should work.

Taddeusz answered 3/9, 2015 at 15:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.