How to differentiate between dialog close by submission and x pressing

I am currently using Dialog component and passing null when action fails like saving or editing. Then I display notification that edit or saving failed.

Now, if user presses X in the dialog then it does the same thing returns null and cause that notification to appear. Is there any way to differentiate between both closing methods ?

The only way is to leave null only for close button and for all other cases to return something identifying the action.

ok thanks. Also, is it possible to have confirmation dialog with yes no before closing dialog ?

Maybe you can simply hide the close button using ShowClose = false in options.

Yes, but even then is it possible to have yes/no confirmation ? For example if user edits and tries to close without saving ?

What stops you to invoke confirm dialog when attempting to close the main dialog?

1 Like