• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Freeze browser after clicking link until new page is returned  RSS feed

 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks.
 
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Yuck...
 
Ranch Hand
Posts: 4702
9
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think your best bet is to just warn them(somehow) that it will take a while.
 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
:roll:
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all.
I will just warm the user for now.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
MS
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!