Home
Username:
Password:
Developing iPhone Web Apps Tutorials

Exploring Bindings / Using a Progress Monitor




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

Now, we've been looking at data sources and feeds for a while and you've seen how we have content here and we have components within it and we can expand and contract them but I haven't talked about one other item here, which is right down below. It's not within content, it's next to it. It says query in progress and this is not something that is loaded from the feed with content. It is something that the dataSource tells us about what's going on; specifically that a query is in progress. Now, how can you use this? Well, let's open the library and we have buttons, containers and so forth. We have this collection of indicators here and what I'm going to do is to show you how we can connect the operation in progress to an indicator and these indicators have a variety of settings to them and some of them have to do with a critical level. This one is the standard activity indicator that lets the user know that something is happening. It doesn't have a specific indicator level. It doesn't say, you know, that the job is ten percent done or fifty percent done. We don't know how long it's going to last but it lets the user know that something is going on and so I'm going to move this activity indicator up here and as you might have guessed, I'm going to bindqueryInProgress to the activity indicator and what that does is now I have a different set of attributes to which I can bind it and what I want to do is bindqueryInProgress to the animating property and what that means is that while the query is in progress, this indicator is going to spin. I'll just move it a little bit over here so it's aligned and it's already you can see aligned with the text and the button over here so let's see what we've got and what we've got is almost good. See? Here we have the indicator indicating that something's going on and now I'll go to the details and nothing's going on and we've still got this indicator sitting here not doing anything. So it's really, it's a good start but it's not quite good. So let's get rid of the simulator and come back here and I'm going to do something that I can't do over here. I'm going to do it in the Bindings Inspector and you'll remember that I bound the dataSource toqueryInProgress using animate, the animating section. But what I'm also going to do is bind the data sourcequeryInProgress to visible so that it is visible only when it's running. How this happens we'll deal with later but usually with an activity indicator, what you're doing is your binding both to the visible property and to animating. So let's run it and see what happens. Now, we're coming in here, it's running, the data is loaded, it's no longer visible. When I come down here to the next level, I don't see it at all. So it is only there when I'm actually doing something. Now, it's very similar to the indicator up here when we're going out over the Internet. This will happen a little bit more often because other things are going on but as you can see, when I reload the page, this flies, so does this one and as soon as I've got the data, this stops and it doesn't reappear when I go to another page and the way I did that and you'll do it very often, is to put an activity indicator up here where it would appear to be visible at all times so that, for example, here it is in this list. On the detail box page it's right here but we don't see it because it is bound to be visible only whenqueryInProgress is running and it picks up animation from it. So it's visible and it's animated whenqueryInProgress is running. And that concludes the section on bindings and interactions with the feed.

Tutorial Information

Course: Developing iPhone Web Apps
Author: Jesse Feiler
SKU: 34075
ISBN: 1-935320-89-0
Release Date: 2009-12-31
Duration: 8 hrs / 103 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available