onHide Performed in Web Client when browser closed?

In web client, when would the onHide method be executed? Specifically would it be executed when a users closed a browser window/tab?

no onHide of a form is executed only when you go from 1 form to another.

The browser close tab/window is currently not catched, so no onhide will be called. Not all browsers support listen to an unload at this moment.

If I were to start a transaction in web client, how would you recommend I ensure it is committed or rolledback?

I can’t stop a user from closing the browser per se…so maybe transactions are not the best idea in web clent? I start one, I really have no bulletproof way to ensure it won’t be left open.

Never use transactions in the webclient, unless there is no user interaction required to close the transaction.

For example, you can work with autosave off and then, when the user hits the Save button, you start a transaction, do a databaseManager.saveData(), check the result of the save (did records fail or not) and then rollback or commit based ont he result.

This allows you to rollback the changes, but the commit or rollback happens inside the same method, meaning that a transaction can never remain open.

Paul

Got it. Good to know!!