How to show confirm dialog before grid editor commits changes ?

I would like to show a confirmation dialog when the user clicks save on the Grid editor and depending on the user input either commit the changes (the default behavior when clicking save) or revert them (the default behavior when clicking cancel). The problem is that the EditorSaveListener that I can pass to EditorImpl is called only after the changes are written to the underlying bean. I tried using a custom subclass of EditorImpl and overriding the boolean save() method, but but I could not get it to work properly. For example calling cancel() inside save() will not let me re-open the editor after it closes (I think because of the rpc.cancel() call in cancel()). Calling doClose() does not close the editor (even though the same seems to work when the cancel button is clicked (?). In any case it does not seem right to rely on such internal details and I’d be happy to hear about a better solution.

Yes, there is no API in Grid’s Editor which would enable you to do this easily. As your use case approaches proper master detail pattern, you probably need to implement one. I.e. you could create custom form for editing or use Grid’s details row with mini form. In both cases you can have your own cancel and save buttons there with what ever logic you want.