This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes Dispaly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Dispaly "Saving please wait" message when submitting the form " Watch "Dispaly "Saving please wait" message when submitting the form " New topic
Author

Dispaly "Saving please wait" message when submitting the form

Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Hi All,

I am developing a from in which when the user submit the form ( using command button or command link) it should save the contents into the database , while the user waiting for saving into the database , i just want to show him something like Saving please wait ( of course all the elements in the form should be disabled during the waiting )..


is there any way to do that ..
Anjali Raman
Ranch Hand

Joined: Nov 28, 2007
Posts: 57
Hi,
I am not sure if this working perfectly fine as your requirement, but you could try this java script in your JSP:



This should give you the message and will also disable the contents on the page.
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Hi thanks alot for your reply ,

I have tested it , it seems something acceptable but I have to end the waiting once the saving to the database is over ..

how I do perform that
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Hi All,
Any reply ............
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Any reply ...................
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16095
    
  21

"Bumping" is not encouraged on the JavaRanch. If you don't get an answer fairly quickly (meaning a few days, not a few minutes, since we don't get paid for this), it's usually because no one else knows either.

Your biggest problem has to do with the atomic nature of HTTP. When you click a submit button, you can't do anything else but wait for a new page view to be returned to you. You can't pop up one of the stock JavaScript dialogs, because they're modal and will "hang" the submit until the user dismisses them.

You can pop open a new browser window, but that kind of behavior really annoys some of us. You could simply modify the page view prior to actually submitting to display the message on the page body. Which goes something like this:




Customer surveys are for companies who didn't pay proper attention to begin with.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

There are a couple of other ways I can think of where you could end the waiting message.

You could reload the page they are on to erase the message.

Or you could can do this using "Direct Web Remoting". I have an application where I do some processing that can take anywhere from 45
minutes to 2 hours. I use DWR to display a progress message so the user can see that something is actually happening on
the server.
 
GeeCON Prague 2014
 
subject: Dispaly "Saving please wait" message when submitting the form