The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

"Your request is being processed" screen

Howdy all,

We are wanting to implement a "Request is being processed" screen ala Expedia and other sites. Basically a user would submit some information, the app would fire off the request in a seperate thread, and wait for a call back, all the time writing a auto-refreshing page to the user that checks if the call back has returned.

My biggest question is what would be the best way to check the call back value. My first swipe was to have the call back set a session variable with the returned object, which my app could then parse. That works great for a single page, but I have two or three hundred seperate implementations, which would all use the data differently.

I'm looking at implementing a service controller or transform view to help with the display, but since the data has to be displayed on both Web and WAP pages I'm working on a simple strategy to not only control the display but also the flow.

Does anyone have any information or links or the such to approaching server-side event notification for web pages?
Cory Foy Send private email
Thursday, February 03, 2005
 
 
There is "a" way to do this in a MSDN article

http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/

HTH
dev
Thursday, February 03, 2005
 
 
I've implemented this using two different methods in my current application.  One method was kinda like you described above.  The other method worked differently, but the goals were a bit different.

We wanted to provide visual feedback that the application was busy saving the user's responses.  We also wanted to prevent the user from submitting a form twice.

Here's how we implemented this: Inside the body of the HTML page, we send the normal page display code inside a DIV tag.  We also send a second DIV with the "please wait" message.  The second DIV should be hidden (using CSS) when loaded.  When the user submits the form, we use JavaScript to modify the style properties of the two DIVs.  We set the first DIV to hidden, and set the second DIV to visible.  Then we let the form submit normally.  The user will receive immediate feedback that the request is processing.  When the next page loads, the old DIVs are automatically unloaded from memory, so there's nothing you need to do to "clean up".

The other method is kinda difficult to explain.  It allowed us to handle long-running requests asynchronously, in a programming language which doesn't natively support that.  If you're interested in knowing how we did that, let me know and I'll try to explain more.
Ryan Send private email
Thursday, February 03, 2005
 
 
Thanks for the replies. Client side is out of the question here - the main problem we are solving is that WAP requests through service providers timeout after 5-10 seconds on their proxy side, so we have to basically keep that alive by sending a page which just refreshes. But, because we do both HTML and WAP pages, any solution has to work for both.

The MSDN article looks interesting, I'm trying to avoid simply storing an object that has the HTML I want to display, because that means I have to render the HTML I want to display. :) But it might give me a direction.
Cory Foy Send private email
Thursday, February 03, 2005
 
 
I finished up a solution this morning, and posted the results in my blog in case anyone else comes across something like this again:

http://www.cornetdesign.com/2005/02/your-request-is-processing.html
Cory Foy Send private email
Friday, February 04, 2005
 
 
A nice way to do this would be to use XMLHttpRequest, which lets you do true callbacks to GETs or POSTs to form actions server-side. There's a good overview <a href="http://developer.apple.com/internet/webcontent/xmlhttpreq.html">here</a> (which by no means is Mac-specific). Google for lots lots more.
andrew
Friday, February 04, 2005
 
 
Hi Andrew,

Unfortunately this solution had to work on both HTML pages and WAP Mobile pages, where the only thing you have to work with is a <timer> card. But thanks for the link!

Cory
Cory Foy Send private email
Saturday, February 05, 2005
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz