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?
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/viritin[url]
https://vaadin.com/directory#!addon/viritin
[/url] has a method called refreshRows(). Using it might do the trick as well.
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.