• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to show a "processing" message  RSS feed

 
JD Glanville
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question concerning about showing a "please wait, processing ..." message when I'm performing long execution.
I have a few custom tags that perform work that can take up to a minute (longer then the standard 7 seconds). I need a message displayed to the user that shows that I'm actually doing something.
I've looked back into the history of this topic area and I've found a suggestion or two. One suggestion was to have a three page process: page one is the form accepting the information, page two contains the "processing" text and a hidden form, duplicating the first form's information and performing a javascript script that submits the information, the third page is the page that actually performs the work.
While this suggestion works, it isn't a situation I'd like to be in. For example, if you have many forms, you don't want to have to duplicate all these forms. Also, it would be a maintenance nightmare: what happens when new guy Bob comes in without knowing this duplicated structure, makes a modification to the original form, but then gets confused when the worker doesn't get all the information? It's a maintenance and debugging nightmare.
So, is there a way that I can print to a page, tell the page generator to flush that information to the client, and still be able to print more information to that page a short period later?
For example, can I have the following piece of JSP:
----------
...
Please Wait ... Processing ...
<taglib oWork />
finished
...
----------
where the "please wait" message is displayed, the browser looks like it's still loading, and when the <taglib oWork> tag is finished, the "finished" text gets displayed?
 
JD Glanville
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about the big grin graemlin. Thats supposed to be (if I've remember to disable smilies)
<taglib:doWork/>
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the previous projects that I worked on used a small JavaScript function to do this.
The function dynamically displayed a message on the page by changing the visibility assigned to a <DIV> tag in the HTML, hid the Submit button (to avoid double submissions) and then submitted the form.
Hope this helps.
(I am not a JavaScript guru but I could probably dig out some code if required)
 
JD Glanville
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andy Bowes:
One of the previous projects that I worked on used a small JavaScript function to do this.
The function dynamically displayed a message on the page by changing the visibility assigned to a <DIV> tag in the HTML, hid the Submit button (to avoid double submissions) and then submitted the form.
Hope this helps.
(I am not a JavaScript guru but I could probably dig out some code if required)

I'm assuming that your JavaScript code would look something like the code that Balaji Loganathan posted in the middle of this thread: http://www.coderanch.com/t/281524/JSP/java/please-wait-message-while-jsp
If your solution is different, I'd like to see it if you can find it readily.
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!