Forums Register Login
Freeze browser after clicking link until new page is returned
I have a link in a page that invokes a servlet. This servlet runs for quite a while before returning another page.
How to freeze the first page so that the browser user can’t click any links on this page until the servlet is done and a new page is returned?
That could be tough and code is probably not going to be pretty.
I suspect you'd need to use javascript and put an onClick event on every possible button push and link click (...and that won't cover using the back button, typing in a new address, etc...)
Just before you went to submit for your long running page, you might update a javascript variable called processing.
The onClick method would be passed in the destination of the "click", but before it did anything it would check the processing flag. If the processing flag was on, then you might pop up a message telling them they can't continue until the process returns or warning them and letting them decide whether to wait or continue with their intended action.
i think your best bet is to just warn them(somehow) that it will take a while.
You may be able to sort of do that by opening up a modal window and see if it is possible to disable a close button through java script.
Just an idea. Don't know if it works.
Thank you all.
I will just warm the user for now.
Here's what I do --see if this would work for you..
Use span tags , and set the attribute style to visible /hidden as required. When u submit the form, hide the span . Also, u could display a span with "Please wait ..." text...
You could also first go to a jsp page with a message telling of the delay and no other links, that forwards to the servlet.
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database

This thread has been viewed 986 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 20, 2019 12:13:22.