Tuesday, May 10, 2005

Hi Brad,

> When you do the redirect do you
> immediately lose your "please wait" text? In other words does the user
> momentarily see "please wait", then see a blank page until your long job
> is processed and can return some results?

Well, on my tests, the "please wait" page stays displayed until data starts
coming in from the "confirm" page. No blank page--at least on my tests it
seems to move smoothly from one screen to the next.

My actual page handling process is as follows:

form.a4d = page where user fills out form, presses SUBMIT; form action
directs to "wait.a4d"

wait.a4d = please wait page, where form vars are saved to session vars and
page redirected (via meta tag or javascript) to "process.a4p"

process.a4p = page where all code heavy lifting is done (all written in
Active4D--I'm using the ".a4p" suffix to indicate this is a processing page,
not for display). When completed, it redirects to "confirm.a4d". No display
is generated from this page, only redirect on termination of results

confirm.a4d = final display with results

So the user fills out the form, presses SUBMIT, then immediately sees the
"please wait" page (and perhaps a spinning beach ball cursor from the
browser--I didn't set up any animated GIF, although this would be the next
thing to do to make it look prettier). This page stays displayed until the
"confirm" page rolls in. I can see on the status line on the bottom the
request for the "process.a4p" page, which just sits there while the
processing is going on, then it changes to the "confirm.a4d" page and this
is displayed.

In my (very limited!) tests, I haven't seen any "blank" page or anything
like that when any of the redirects kicks in--the "please wait" page just
sits there. Now that I've got this working, I plan on trying a variety of
browsers on both Mac and PC (up to now I've only been using Mac).

> Or do you assume it will take
> X seconds and pause for that long before issuing the redirect?

I didn't program any sort of waiting period in the redirect on the "please
wait" page, but redirected immediately (well, in 1 second). I suppose if
this "blank page" does pop up, I can make a guess at how much time it'll
take, changing this parameter (say to 5 seconds), then redirect.

The main things I want to accomplish with this are:

1) give the user some feedback that the request was submitted, and

2) get them off the form page so they don't sit there clicking the SUBMIT
button over and over.

So, for these two goals, it seems to work (again, in my very limited
testing). 

> But then again if its a really
> long job it might benefit from running as compiled code?

It will be running compiled; these tests were all done interpreted, running
the server and browser on the same computer (my test computer), which gives
me an idea of how slow it might be (sort of worst case scenario). Once I get
this up on the production server (which is faster than my test computer),
and compiled, I may end up scrapping this whole thing if it ends up being
fast enough. 

However, this method I see being useful in a possible future situation: a
credit card submission form, where you relay the info to a 3rd party to
process the credit card, wait for the confirmation, then send the results
back to the user. Since the time for this processing is completely out of
your control, having a "please wait" page would seem essential.

Anyway, it sounds like you're saying the meta tag should work well enough
for most browsers? As I mentioned, I'm sort of doing this all based on
theory right now and don't have a lot of real world experience (which might
indicate a better approach). Do you know if the meta tag fails in some
situations or browsers? (If it fails, this would screw up the entire
processing, as the server would never get the request for the "process.a4p"
page and the user would end up waiting a very, very long time...)

Thanks for your help!

Cheers!

Michael Larue


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to