Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

How to display a "Please Wait" page

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


ccondray at gmail

Aug 10, 2008, 7:22 PM

Post #1 of 2 (287 views)
Permalink
How to display a "Please Wait" page

I am in the process of creating a website using catalyst. I have a check out
page that processes payment information and performs some automated tasks
for the client that takes several seconds to complete. I'd like to display a
"Please Wait" graphic while these actions are occurring.

I my initial attempt was something like this:

$c->response->redirect( $c->uri_for("/checkout/pleasewait") );

# Do action and payment process

$c->response->redirect( $c->uri_for("/checkout/receipt") );

But that was unsuccessful. I definitely think I'm misunderstanding how
redirect works. Has anyone else done anything like this before and if so
what are the steps that need to be taken to make it work?

Thanks in advance for your help and please let me know if there are any
further questions about what I'm trying to do.

Collin Condray
condray.net


tjc at wintrmute

Aug 10, 2008, 7:49 PM

Post #2 of 2 (263 views)
Permalink
Re: How to display a "Please Wait" page [In reply to]

On Sun, Aug 10, 2008 at 09:22:40PM -0500, Collin Condray wrote:
> I am in the process of creating a website using catalyst. I have a check out
> page that processes payment information and performs some automated tasks
> for the client that takes several seconds to complete. I'd like to display a
> "Please Wait" graphic while these actions are occurring.
>
> I my initial attempt was something like this:
>
> $c->response->redirect( $c->uri_for("/checkout/pleasewait") );
>
> # Do action and payment process
>
> $c->response->redirect( $c->uri_for("/checkout/receipt") );
>
> But that was unsuccessful. I definitely think I'm misunderstanding how
> redirect works. Has anyone else done anything like this before and if so
> what are the steps that need to be taken to make it work?

Do you understand how HTTP redirect works? If so, then understand that the
catalyst response->redirect is essentially exactly the same.
As a result, you can only send one, and when the client receives it, they will
leave the current page.

Perhaps try making pleasewait(), do_payment_process() and receipt() actions.
Send the user to the pleasewait one, which just displays a "Please wait.."
page, and kicks off the payment processing in the background. Have it set up to
move the user over to the receipt() page once things are complete. (You can do
this via javascript, but remember to have a fixed old-school http redirect with
a time-out too, in case the user has an antique browser, or something goes
wrong).


Cheers, Toby


--
Turning and turning in the widening gyre/The falcon cannot hear the falconer;
Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world
(gpg --recv-key B1CCF88E)

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.