hclleapforum

Open full view…

Looking to add listener for user closing the window without responding

vstanwyck
Fri, 23 Oct 2020 19:31:53 GMT

We have a form we are planning to direct users to that requires them to submit a single field. We would like to trigger an event (in this case, I am calling JSON to create a record in a new form) when the user closes the window without responding. I originally called my function onDestruct, but it looks like that only works if they click "Cancel" and not if they just close the window. I have tried writing in a listener onLoad (see code below) to listen for the closure with the addEventListener() method, but it throws the "app.getSharedData().addEventListener() is not a function" error and then runs my "noResponse" function anyway. ////////////////////////////////////////////////// // Listen for form closing ////////////////////////////////////////////////// if(BO.F_SelectOne1.getValue() === ""){ app.getSharedData().addEventListener("unload", app.getSharedData().noResponse()); } Does anyone have any experience with the "onUnload" event, and how would I call that in Leap?

christopher_dawes
Fri, 13 Nov 2020 19:19:45 GMT

Leap does not currently offer any mechanism for detecting or reacting to a browser close event.