Prev | Current Page 283 | Next

Frank Zammetti

"Practical DWR 2 Projects"

Composing a new message (or a reply to a message)
gotoComposeReply() comes next, and it??™s very much the same as gotoComposeMessage().
However, since the Reply button only has meaning in the Message view, we need to check for
that and abort if the user is seeing another view. Beyond that, like gotoComposeMessage(), we
are prefilling the fields on the Compose view, namely the address of the sender of the message
and the subject with ???RE:??? appended to the front, and the message itself is quoted below a
divider line demarcating it from our reply.
The next function we see is newContact(). It??™s almost the same as editContact(), except
that we??™re setting the entry fields to blanks, and of course making sure all three edit boxes are
now enabled. Otherwise, it is much the same thing.
CHAPTER 4 n INSTAMAIL: AN AJAX-BASED WEBMAIL CLIENT 150
The last non-Ajax function we encounter is gotoHelp(). This is what gets called when the
user clicks the help link on the bottom of the page. It??™s about as simple a help system as one
could imagine: based on the current view, it pops a JavaScript alert() box with some text
describing the current view. Perhaps not the fanciest way to provide online help, but it certainly
gets the job done!
Finally, Some Ajax to Look At
Now we??™ll start to look at the Ajax functions using DWR, which is where all the truly interesting
stuff happens.


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