Control over IE Window Closure

O

Oxy

Dear all,

I am currently strungling with the fact that I want to control the
browser closure. In fact, I have a webbased application in which I use
a wizard. Ones the wizard starts, a lock is set on specific objects in
the db. On all pages of the wizard, the user get the possibility to
exit the wizard by clicking on a custom "Exit" button. That way, I know
that the user has left the wizard and that way I can unlock the locked
objects in the db again.

So far, so good. But users are used to close browser windows by
clicking on the "X" in the titlebar. If they close a window that way,
the locks aren't unset and no other user may start the wizard again. If
I should know that he had clicked on the "X", I could unlock the
objects.

I have searched a lot on the net but all results aren't sufficient for
me.

Some solutions which don't work:
1) onunload event: => Also called when the window is refreshed or
forwarded.
2) "titlebar = no" property while opening the first page of the wizard,
is not working (the titlebar is still enabled). And even then, the
users can close the window by clicking CRL-F4. This key combination
isn't disabled by the "hotkeys = no" property.

! Note: if the client's pc crashes or if the user kills the wizard
process via the task manager (exceptional cases), they have to call
maintenance to reset the locks. This is a requirement, defined by
bussiness.

Could somebody help me?

Thanks in advance,
Wesley.
 
M

marss

Oxy напиÑав:
Dear all,

I am currently strungling with the fact that I want to control the
browser closure. In fact, I have a webbased application in which I use
a wizard. Ones the wizard starts, a lock is set on specific objects in
the db. On all pages of the wizard, the user get the possibility to
exit the wizard by clicking on a custom "Exit" button. That way, I know
that the user has left the wizard and that way I can unlock the locked
objects in the db again.

So far, so good. But users are used to close browser windows by
clicking on the "X" in the titlebar. If they close a window that way,
the locks aren't unset and no other user may start the wizard again. If
I should know that he had clicked on the "X", I could unlock the
objects.

I have searched a lot on the net but all results aren't sufficient for
me.

Some solutions which don't work:
1) onunload event: => Also called when the window is refreshed or
forwarded.
2) "titlebar = no" property while opening the first page of the wizard,
is not working (the titlebar is still enabled). And even then, the
users can close the window by clicking CRL-F4. This key combination
isn't disabled by the "hotkeys = no" property.

! Note: if the client's pc crashes or if the user kills the wizard
process via the task manager (exceptional cases), they have to call
maintenance to reset the locks. This is a requirement, defined by
bussiness.

Could somebody help me?

Thanks in advance,
Wesley.

Save the data that collected during wizard in a temporary storage (for
example, Session in ASP.Net) and write it to db if only wizard is
succesfully finished.
 
O

Oxy

It's not really a matter of writing data to the db. If I would adapt
your suggestion on my problematic, then I should lock the objects in
the db when finishing the wizard, but that is not what is required.
When somebody starts the wizard some objects must be locked in order
that other processes may not use these objects until they are unlocked
again (by finishing the wizard).

Is this a bit clear?

marss schreef:
 
O

Oxy

Hi all,

I just reviewed the design and in fact it is not a db lock but a Java
object lock. (but this isn't the core of this question).

Oxy schreef:
 
T

TC

Oxy wrote:

I just reviewed the design and in fact it is not a db lock but a Java
object lock. (but this isn't the core of this question).

You may want to look up the terms "optimstic locking" and "pessimstic
locking" (if you don't already know them). You are currently using the
latter. You might be able to solve your problem by using the former.
These two locking methods are applicable to any situation where you
have to manage update access to shared resources. They are nothing
specific to javascript as such.

HTH,
TC (MVP MSAccess)
http://tc2.atspace.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top