How to add a save confirmation dialog

Can anyone help me to add a save confirmation dialog to an Edit screen? I would like to add a “Yes” / “No” dialog screen to confirm saving when the “OK” button is clicked. If “Yes” selected, then the record is saved. If “No” selected, the control should return to the Edit screen without saving.

Override the commitAndClose() method in your screen controller:

public class CustomerEdit extends AbstractEditor<Customer> {
    public void commitAndClose() {
                "Are you sure you want to save changes?",
                new Action[] {
                        new DialogAction(DialogAction.Type.YES) {
                            public void actionPerform(Component component) {
                        new DialogAction(DialogAction.Type.NO)

Thanks Konstantin.

Before this, I managed to do it in preCommit(). Very interesting to see this using the commitAndClose() also.