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 editor close command
What is the command to close the grid editor programmatically without actually clicking on the cancel button?
Do you mean equivalent to Cancel, no saving, but programmatic, it is Grid.cancelEditor(). There is also Grid.saveEditor().
Because I override Grid.doEditItem() seems I must first call super.doEditItem(); and then super.cancelEditor(); (do not want the row to be edited if a condition is true).
Can you please also advise why after cancelEditor is called I need to double-click twice or 3 times for the editor to appear again on a valid line?
private class MyGrid extends Grid{
@Override
protected void doEditItem() {
super.doEditItem();
if (...) {
super.cancelEditor();
}
}
}