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.
We'll start by creating the two-level browser that is part of the template. That's the browser with the list on the first page and then details beyond that. I don't care about Safari. I'm only going to do it for iPhone. So let me create that template now. And the first that I always do, when I create any project from any template, is to run it in the simulator just to make certain that what I've downloaded and created will work the way I think it will. And here it does, so I'm fine. I don't have to worry about that. I've got a reasonable object. Now, let's take a look at how this is handled in the template and what is going on behind the scenes. I can pull up the Inspector here and we can see that the first row, the template row in the browser, has an onclick handler. It is called Item Clicked. This is part of the template and I pointed that before. It is not here. It is not the arrow. It is this whole row is hot. So let me look at Item Clicked and this is the code that came down and was installed as part of the template. And, let me just move this a little bit more so we can see more of what's going on here. I don't need to see the Inspector. This is the function that does the work of going to the detailed window. When I click here, this function is called and I go to the detailed window. The first thing that I do is ask the document to get me the List Element. That's here. That's the view here. You can see it's highlighted here. This is the list that contains the List Row Template, watch over here as I'm clicking, the Title and the Arrow. So all of those are contained within the list, which itself is inside the List Level view and that's the stackLayout. So I get this list object and then I want to get a reference to the Browser Object, which is way up here that contains everything. And what I want to do next is get from the list object, here, all these lines. I want to get the selected objects, which is everything that I've selected in this list. The option is set so that I can only have one item in this list selected. So the effect of this line of code here is to give me the single item in this list that has been selected. If I found it and the length is one, that is only one is selected which should be always the case in this browser, then I call another function called goForward for the browser which gets an element by ID, the Detail Level, that's over here. I'll open it all the way up. It goes to Detail Level and it gives me the second parameter to the goForward function is whatever the selected objects is, whatever part I've selected in fact, the value for the key name is the second parameter to goForward. So this is the handler that's built in that is going to flip me to the specific detailed information for the given park. Now let's take a look at goForward. We're in main.js and we look for it and goForward is not here. So goForward has been added to one of the other files in this template and we'll look for it by searching for it and take a look at exactly what goForward does.
| 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: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |