CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Show Loading Picture-RESOLVED

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 02/23/2012, 2:29 PM

Hi All.
I have some pages that execute SQL code when a user clicks a link.
Right now they just stare at an empty page while the DB does its thing.

For the few minutes they are waiting I would like to display something.

I have the sql code in the Initialize View event of the page.. and it redirects to another page of code when its done.
Any way to echo a message or display a gif while it is working?

Thanks!


_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
clahti2

Posts: 107
Posted: 02/27/2012, 3:29 PM

easiest way to do this is to have your "interim" page do an asynchronous ajax call to a "processing" page which does the db work, I cannot post the actual code example because CCS forum suppresses AJAX code (which it should). I have this exact situation where I actually call six pages in series, the "interim" page uses an AJAX progress bar to show the steps. You could use output from a single "process" page to drive the progress bar as well. Have a look at:

http://www.bram.us/projects/js_bramus/jsprogressbarhandler/

for the progress bar, then use Prototype function Ajax.Updater() to make the call. There is actually an example in the source for this progress bar on the Prototype function. You listen for info coming from the process page to both update the progress and update a DIV control, once you capture the javascript onComplete function you then use window.location to then redirect to your "thanks for waiting" page :-).

Doing a single AJAX Ajax.Updater() call is a piece of cake, doing six in series to a while to figure out, but works well in any case.

/Chris
View profile  Send private message
clahti2

Posts: 107
Posted: 02/27/2012, 3:46 PM

something possibly slightly less complicated would be to put an animated GIF file on the "interim" page while the Ajax.Updater() or Ajax.Request() does the work, have a look at Prototype docs:

http://api.prototypejs.org/ajax/Ajax/Request/

If you want the process initiated by a button click you could put the GIF in a panel that is hidden, and set the Visible property to true and fire the AJAX call in the onclick button event.
View profile  Send private message
ckroon

Posts: 869
Posted: 02/29/2012, 9:19 AM

Thanks!
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.