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're now going to add the ability to delete tasks. But first let's group the our UI windows into their own folder. The first thing we need to do when deleting tasks, is put up a dialog asking the user, if they are sure. So you add a new UI control, called the dialog. The delete task dialog will simply have some text and a couple of buttons. We'll add a new property to this dialog, called Button pressed. We will check this property later so we know which button was clicked. Cancel or OK. In the action event for the Cancel button, we will set the button pressed property, and close the dialog. We will do the same thing in the OK button. Now we will add our delete task dialog to the ToDo page. You will notice this drop area opened up when we dragged it in. We will now create two new methods. The first is show delete dialog. Here we will get the selected task and display the delete dialog. We will then add a second method that actually deletes the task. This will also get the current task. This calls the remove row method on the list box to remove the task from the list, if the task was successfully deleted from the database. We call the delete task method, from the dismissed event of the delete dialog. A dismissed event is called when the delete dialog closes. You'll recall that the delete dialog is closed whenever either of these buttons are clicked. Here we can check the button pressed property. If the button pressed property matches the delete button itself, then we will delete the task. Let's run our project and let's fix the name of this button to make it clear that the user will be deleting the task. Now let's run our project. Everything compiles successfully, so now we need to hook up the button to our method. In the action event of the delete task button, we will show the delete dialog. When the delete dialog closes, a dismissed event is called, and if they press the delete button, we then delete the task. We get our drop down and the task is deleted.
| Course: | Real Studio |
| Author: | Paul Lefebvre |
| SKU: | 34190 |
| ISBN: | 1-936334-77-1 |
| Release Date: | 2011-02-02 |
| Duration: | 7 hrs / 87 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |