Home
Username:
Password:
Developing iPhone Web Apps Tutorials

Using Indicators & Transformations / Adding the Indicator




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 what I want to do is to add an indicator from the library and I will look at the various indicators and what I will be able to do is I can just shorten this up a bit and let me put in a Vertical Indicator which will sit over here. And while I'm making some adjustments down here, what I can do is come up here to the Inspector and in that text area, say that it's not editable. Nothing is bound to it so I don't have to worry about that. This should be OK. And I'm gonna come in here and what I want to do now is to bind this transformed value to the indicator. So let me look at the Level Indicator and what I want to do is to bind this to the grid, key path selection. And where are sign-ups? Sign-ups are down here. But I need that same transformer. So I'm gonna go to percent. And now, I've got the value bound to the indicator and the range that I want actually, the range is going to be zero to one because these are decimal numbers, not percentages. And the capacity, what I want is the critical is going to be 0.9, warning is going to be 0.5 and the threshold is going to be 0.01. So let's see what happens when I do this. I'll run it now and then we'll come back and take a look at it. I can close this safe from the keyboard and run the simulator. Now here I have a value of 0.26 and notice that the indicator is green. Here I have a value of 0.66 and the indicator is yellow. As I run through the various other values, this is zero, no one has signed up at all. 0.3, is said so that 0.5 is the caution area, the yellow area. And you'll see as I go through, this one is 0.6 so the indicator is yellow. All of that was done simply by converting this value from the grid using the transformer. These fields no longer matter because I don't need to see them anymore because what I'm saying over is that this is the warning sign of what percentage of the event has been reserved. I could provide other information. For example, I could show the number of seats that are available. So I could put a transformation on here which is capacity and then show capacity minus sign ups, which is the available capacity. That's quite possible. If you'll notice that what I did in the actual transformer, I was working with the dataSource, which at this point isn't changeable. I can always go back to the dataSource and pull out those values and do something with them. So I can muck around with these fields all that I want to because the dataSource is intact and I'm now providing this indicator to give people an idea of how much space is available out of what's available in the room. So, here you have an indicator that responds to updates. This is a good example of something where the dataSource should be updated on the web so that people can update it as events happen as more people sign up. It can be generated, in fact, from a database, from FileMaker, or from other applications, so that those numbers, the number of sign ups, are created dynamically as people are entered into a database or a website or whatever. So here, you can see what we've got is the interplay of the data and the indicator here that gives us someway of interpreting that data. So here we have and this is totally off because no one has signed up. So I'm going to leave these here for the moment because it will serve as a check on the actual values. 0.8 obviously is still in the green level. So this is an example of how you can put things together. You could even put this together in the initial list so that the list of libraries could contain the library's name. You could add an event to it but you can also add an indicator so that people can see which libraries have events coming up for which there is availability if you want to go to some event. Then you have to click to find out what the event is and what the time and place is. So indicators are an incredibly useful piece of Dashcode. They're very easy to use. They often are tied to transformers and they provide great added benefit to your users.

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