Hi,
Targeting Genero 4.01 GWC via GAS.
When writing a simple Hello World GUI with only 1 label ("Hello World"), how can the Google Chrome window.closed / window.closing event ('beforeunload' event) be trapped to tell the 4GL that the web client is closing?
Is there a way to add the following javascript to the web page served by the GAS?
<script type="text/javascript">
uno onlinewindow.addEventListener('beforeunload', function (e) {
// Tell the 4GL program that Google Chrome is closing
});
</script>
In your GBC application, you can include the following JavaScript snippet to detect when the user is closing the browser window:
JavaScript
<script type="text/javascript">
window.addEventListener('beforeunload', function (e) {
// Your custom logic here
// For example, notify the 4GL program that Google Chrome is closing
});
</script>
Replace the comment with the specific action you want to take when the user closes the window. I hope it can help.