Prev | Current Page 823 | Next

Frank Zammetti

"Practical DWR 2 Projects"

In general, each element calls some
method of the timekeeper instance in response to the onBlur event, and most of them pass as
arguments to that method either the value of the form field itself or some piece of information
from the User object (which is resp[i], since we??™re iterating over an array of User objects), and
sometimes both. There is also the Delete button, which again simply calls the appropriate
method of timekeeper.
After that loop is another dwr.util.addRows() call, this time essentially creating a row
where each cell contains an
element, and that??™s how the dividing line gets into the table.
Following that is the addition of the row for adding a new user, which is conceptually the same
as any of the rows for editing existing users, except that nothing is done onBlur this time; it??™s all
triggered off clicking the Add button.
addUser() The method called to add a user is fairly simple, and consists of the following code:
this.addUser = function() {
var username = dwr.util.getValue("divAdminUsers_add_username");
var password = dwr.util.getValue("divAdminUsers_add_password");
if (username == "") {
alert("Please enter a username");
return;
}
if (password == "") {
alert("Please enter a password");
return;
}
UserDAO.


Pages:
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835