Detecting when the user closes the window or tab of the browser in a Html DIalogDialog
Hello! I have the following scenario:
1. User goes to the their Personal Task List;
2. There's 1 task;
3. User closes the window or tab in the browser;
4. User comes back in 5 minutes and goes to their Personal Task List;
5. The task is gone;
6. After 30 minutes, the user refreshes the page;
7. The task is back;
**Question 1.**
I understand that since the user started to work on that task (step 2), it changed from SUSPENDED to RUNNING, and other users are not able to see that task in the meantime. I don't understand why even the user that is working on that task, can't see the task in the Personal Task List.
**Question 2.**
Using Html Dialog, How to detect when the user change the context on the browser, to bind it to an event in the Logic? For example, if the user closes the tab/window, then it would fire a process to change the task to SUSPENDED again.
I found old answers but they don't seem to be the exact scenario:
- http://answers.axonivy.com/questions/434/hook-into-global-closing-with-x-on-the-window (It uses [Hook into global closing with "X" on the window][1] - It talks about Rich Dialog and Java Class, I am using Html Dialog and I would like to bind it to an event containing a Script Step with a code in Ivy Script);Script;
- http://answers.axonivy.com/questions/359/how-can-i-logoff-the-user-if-he-closes-the-browser (This [How can I logoff the user if he closes the browser?][2] - This one says that the task would be immediately available for the same user, but this is not what's happening).happening in my scenario.
Thanks in advance.
[1]: http://answers.axonivy.com/questions/434/hook-into-global-closing-with-x-on-the-window
[2]: http://answers.axonivy.com/questions/359/how-can-i-logoff-the-user-if-he-closes-the-browser