Copy link to clipboard
Copied
Hello,
I have and eventListener for beforeClose and in the called function I'm showing a non-modal dialog. I had a modal dialog before, but I have to change this now). With a modal dialog the function called by beforeClose was paused until the dialog was closed. With the non-modal dialog the application continues and the document is closed.
Is there any way to wait until the non-modal dialog is closed?
Thanks
Klaus
Copy link to clipboard
Copied
Actually I think that closing events aren't the kind of events you can mess with. You can certainly be notified but you cannot prevent its execution (unless I am wrong). So the scenario you are talking about is no surprise.
So depending of what you want to achieve, you may need to change your strategy.
Copy link to clipboard
Copied
Thanks - our extension is a kind of connection to another system. Before closing the document I'm sending previews of the document to our system and the user can 'check in' the document, he can select a workflow status etc. And I'm writing some informations as labels in the document.
So I like to show a dialog for the user, this dialog get's informations from our system using asynchronous communication and the asynchronous communication doesn't work with a modal dialog.
I can retrieve most of the informations I like to display in the dialog before opening it. But after closing the dialog I like to write the labels into the document and at this time it's already closed.
I think I'll find another way with a different strategy..
Copy link to clipboard
Copied
Well in this case add a second eventlistener > afterClose. Everytime a doc is closed, use beforeClose to store doc path.
then on afterClose run dialog, reopen doc with no window and generate previews.
you might want to disable listeners during this phase so it doesn’t fire unnecessary callbacks.
eventually turn them on again.