There’s a lot going on in those two methods, and the result is shown in Figure B-3.
Figure B-3.Populated vet table
What we can’t easily demonstrate in the book is that the call to the server-side Clinic
object and the population of the table all took place asynchronously, without requiring a page
reload in the browser. If the server-side operation is long running, the browser will still remain
responsive for the user, but usually the page updates much faster than when reloading too.
POSTing Updates
We’ll complete the lightning tour of functionality with a look at form posts. In Figure B-4, we
see the same page again, this time after clicking the Find Owner button to bring up a table of
all owners and then clicking the “edit” link for one of them. Both operations are handled by
DWR and update the page very snappily (of course, you’ll have to download the application
and try it out for yourself to see).
The Submit button for the Edit Owner form is linked to another JavaScript function coded
in the file local.js. In turn, it relies on yet more DWR utility functions (did we mention how
much typing it saved you?). Listing B-7 shows the code for the form, and Listing B-8 describes
the relevant JavaScript functions.
384 APPENDIX B ■AJAX AND DWR
584X_Ch14_AppB_FINAL 1/30/06 12:55 PM Page 384