Prev | Current Page 280 | Next

Frank Zammetti

"Practical DWR 2 Projects"

I
believe this will help you understand what is going on in the Ajax code a little more easily.
The first non-Ajax function after that section is the editContact() function, called when
the user clicks one of the existing contacts in the Address Book to edit it:
// Called to edit/delete an existing contact.
function editContact() {
setValue("contactNameEntry", this.parentNode.cells[0].innerHTML);
setValue("contactAddressEntry", this.parentNode.cells[1].innerHTML);
setValue("contactNoteEntry", this.parentNode.cells[2].innerHTML);
setDisabled("contactNameEntry", true);
setDisabled("contactAddressEntry", false);
setDisabled("contactNoteEntry", false);
}
Incidentally, Figure 4-5 shows you what it looks like when you??™re editing a contact.
CHAPTER 4 n INSTAMAIL: AN AJAX-BASED WEBMAIL CLIENT 148
Figure 4-5. Editing a contact
Here, and elsewhere, you may have noticed the this.parentNode call. This is included due
to the structure of the table that is constructed to list messages for either the Inbox or the Sent
Messages view. Recall that both views have a check box as the first item on the row. Originally,
I had all the mouseOvers and onClick events on the row, because that??™s where the information
on the message is stored.


Pages:
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292