Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Grid update/refresh data
I have a grid with a BeanItemContainer. When I update the values of the beans they are not visible in the grid after commiting from the row editor. When I click/select other rows I see them appear (being refreshed). I need to iterate the BeanItemContainer, update bean values and have the new values appear upon commiting. I have tried markAsDirty, clearColumnSorting, setImmediate(true), etc. There must be a solution?
I searched high and low to find this and it worked for me. Looks like a hack?
https://github.com/tyl/mongodbcontainer-addon/issues/8
workOrderDetailGrid.getEditorFieldGroup().addCommitHandler(new CommitHandler() {
@Override
public void preCommit(CommitEvent commitEvent) throws CommitException {
// TODO throw new CommitException() if your validation fails
}
@Override
public void postCommit(CommitEvent commitEvent) throws CommitException {
workOrderDetailGrid.setCellStyleGenerator(workOrderDetailGrid.getCellStyleGenerator());
}
});
The MGrid in https://vaadin.com/directory#!addon/viritinhttps://vaadin.com/directory#!addon/viritin has a method called refreshRows(). Using it might do the trick as well.
https://github.com/viritin/viritin/blob/master/src/main/java/org/vaadin/viritin/grid/MGrid.java#L249-L283
cheers,
matti
Awesome. I love the MGrid. Great job! A much needed add-on, just in time! Thanks.
Hi Matti,
Is there listener available for Grid Editor save and cancel button? I want to perform some action on save and cancel.