Is there a way to invoke the confirmation dialog explicitly?

Is there a way to invoke the confirmation dialog explicitly?

I'd like to use the confirmation dialog, but I want to invoke it programmatically.

The dialog is invoked when you press the button it is associated to
(btw, I found that nothing happened when it was "Ajax Submit". When I changed the button's method to "Submit", it worked).

But, that's still not what I wanted to use it for. Currently It pops up always if you press the button.
I wanted to use it conditionally. So on pressing the Submit button, a Save action is invoked.
This Save action would check if a given condition is true.
  • If true, just submit; without showing the confirmation dialog
  • If false, show the confirmation dialog
     - when pressing OK in the dialog, submit
     - when pressing Cancel in the dialog, go back to the screen without submitting the form
Is there a way to invoke the dialog programmatically, and react depending on the result?

Thanks, Jan-Hendrik
yes there is.

just expand the onlick-functionality.
something like this:

Alternatively, you can have a button without confirm, and a hidden button with confirm. Then in your action do a widgetclick if you need the confirm. You could use the same screen action with a parameter so you know which button triggered it.