Copy link to clipboard
Copied
I made a custom dialog and display it with execDialog() method. This custom dialog has a ok_cancel field. Now I want to let user to choose if he/she really want to exit from this custom dialog by prompt them a Yes_No app.alert dialog.
I already know how to handle some actions when Cancel button is called in that custom dialog, but I do not know how to stop exiting form custom dialog once Cancel action is triggered.
How may I achieve it?
Thanks in advance.
Copy link to clipboard
Copied
This is not possible, at least not if you use the built-in Cancel button.
In order to do it you would need to create your own "Cancel" button, attach a function to it and then close the dialog if the user clicks Yes in the alert window. However, doing so seems to be the same as clicking on OK, so you would need to use some kind of variable to differentiate between the two operations. In short, not a simple task...
Copy link to clipboard
Copied
I'm not sure to really understand your needs, but I already made a custom dialog with YES and NO buttons, where NO is the default.
In this dialog NO (the default) means "do nothing" and YES means "Print".
Could this help you?
(NON = NO, OUI = YES)
Copy link to clipboard
Copied
Yes, I done something similar too. Now, instead of doing nothing, I want to prompt user to confirm if they really want to close that dialog.
Copy link to clipboard
Copied
As mentioned by try67, "not a simple task".
You may need to reference to the following tutorials by ACP Thom Parker (below) in order to customize your own alerts dialogue boxes with an option to collect responses from the user(s):
These tutorials will provide you with PDF examples that include some of the code that you may need which is available for download.
Copy link to clipboard
Copied
Thanks for your response.
Actually I have seen his tutorials before, they helped me a lot to achieve what I have already done.
I already call an app.alert() when I press Cancel (or Escape keyboard) in a Custom Dialog (I mean about dialogs discoused in last tutorial you provided, by adding a "cancel:function(dialog){}" function).
I already can get Yes or No response from the previously called app.alert().
The problem is I do not know how return to custom dialog once Cancel function is called.
Copy link to clipboard
Copied
Ok, in that case share the script that you're currently using or an example of the PDF.
This will make it easier for us to assist you.
Seems like you may be missing a condition to handle that part.
Copy link to clipboard
Copied
Okay, sounds good, I will share it then.
Is there a way to update my post? Or should I open a new one?
Copy link to clipboard
Copied
You may do it here since this is still an ongoing discussion.
Copy link to clipboard
Copied
"Now, instead of doing nothing, I want to prompt user to confirm if they really want to close that dialog."
Technical response: Clicking any button means closing the current dialog box before doing anything else, so answer is: not possible.
User-friendly experience response: Are you serious?
😉