How to Show Status while Retrieving XML Information

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

How to Show Status while Retrieving XML Information

Post by gpearson » Tue Mar 02, 2010 5:30 pm

As I learn this scripting language while creating a real life example, I would like to find a way that when a user clicks a button and my application goes to grab information from a website in xml format that it would display a status to the user. At the present time, their is no feedback when the user clicks a button until the information on the stack changes.

COuld it be possible to display a card while information is being transmitted and then when complete hide the card? Any suggestions greatly appriciated.
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

massung
Posts: 93
Joined: Thu Mar 19, 2009 5:34 pm

Re: How to Show Status while Retrieving XML Information

Post by massung » Tue Mar 02, 2010 6:29 pm

Graham,

Given what direction you are working in, you and I appear to be doing similar-ish things with Rev. First, to give you an idea, here's a screenshot of my RSS app created with Rev that I'm currently alpha-testing with select people:

http://massj.on-rev.com/im/Newsfeeder_Screenshot_01.png

I primarily use Rev for a lot of internet-based applications. Let me take a moment to describe several of the things that took me a while to learn (about Rev), are simple, and helped tremendously.

1. Take a look at the LOAD URL command. This will allow you to download a URL in the background and have a message get sent to your control once it's done loading. Then you can use GET URL to instantly gain access to the XML data you just downloaded.

2. While you are parsing the XML, if you do anything like I do when parsing an RSS feed, the XML will be a highly repeatable tree and you'll be parsing it in a REPEAT loop. In that loop, drop in the following line of code: wait 0 seconds with messages. This will temporarily suspend your loop execution and allow the app to respond to user input, resize the stack, cancel the action being taken, and more.

3. Download a nice animated GIF for use while you are in the process of downloading the XML and parsing it. This is a nice site for generating a few different kinds: http://www.ajaxload.info/. Make the image hidden and when you start doing work, just SHOW the image. As long as you pump messages periodically, the GIF will continue to animate and let users see that something is going on.

I personally do many other things at the same time to inform the user of what's going on. For example, I have a "status label" space reserved at the bottom of the stack and constantly update the text with what's going on (e.g. "Contacting site...", "Parsing headlines...", etc). You may also want to put many of your controls within the same group and DISABLE that group while you are downloading/parsing, so the user can't interact with stale data.

HTH,

Jeff M.

Post Reply