I added a method call to my solution onClose event hook. My method was:
**
* Callback method for when solution is closed, force boolean argument tells if this is a force (not stoppable) close or not.
*
* @param {Boolean} force if false then solution close can be stopped by returning false
*
* @return {Boolean}
*
* @properties={typeid:24,uuid:"0F5045E5-F376-4910-A7BF-82366617CA01"}
*/
function onSolutionClose( force )
{
application.output('onClose bForce: ' + force );
return true;
}
First, how is a value for the “force” parameter passed? I do not call onSolutionClose directly. I thought it was supposed to be called automatically in response to the user clicking the browser or tab’s close box. How then does the “force” parameter get its value?
Is what I am doing right? As far as I can see my method is never called.
I tried this on my solution and on my Login module with the same results.
We are using 202209.2 developer on Windows 10.
We are still working with the NG1 forms. We have not moved to Titanium.
servoy will call that onclose method at the moment we close the client
the force boolean is when its not a user close (like calling application.exit()) but a system close when you can’t stop the close anyway.
it will be called after 1 minute after a tab is closed, but in the developer this is a bit tricker to test. But it you kill the client through the admin page you should see it.
Thanks Johann.
We need to stop users closing the browser tab or window if they still have forms open other than the main tab set, so a 1 minute delay is not going to work.
Any ideas about how we can do that?
Terry
pressing X doesn’t directly mean close solution for us. that is just normal flow and that just lets the session timeout (thats 1 minute by default) and then we clean up the client.
our ngclientutils plugin do have: setOnUnloadConfirmation(boolean) that you can use to let the user know about that they are about to leave a page which they shouldnt
you can toggle that on an off with that boolean.
So is this called once after the user logs in or is it somehow associated with one or more forms?
thanks,
Terry
what do you mean?
you need to call it when you don’t want users to close your tab (or at least try to avoid that they do that)
Servoy doesn’t do that, so i don’t know what you mean with associated with one or more forms.
I figured it out Johan. Thanks for your help.