/**
handles functionality of getting user detail
*/
function getUserDetail(){
//____1 first get the user identification
var box = document.forms[0].userIdentification;
var userIdentity = box.options[box.selectedIndex].value;
alert("userIdentity "+userIdentity);
//____2 Call remoted method, and specify callback function i.e displayUserDetails
userServer.getuserDetail(userIdentity, displayUserDetails);
//____3 Return false to suppress form submission
return false;
}
callback function is
/**
*Display User Detail
*/
function displayUserDetails(user){
//____4 Remove the currently displayed results
alert("callback method called "+user);
// Remove the existing user details if any
//where user is id of tbody
DWRUtil.removeAllRows("user");
DWRUtil.addRows("user",user,cellFunctions);
$("userTable").style.visibility = "visible";
}
/*
* Array of functions to populate a row of the items table
* using DWRUtil's addRows function
*/
var cellFunctions = [
function(user) {
alert ("user.firstName "+user.firstName);
return user.firstName;
},
function(user) { return user.lastName ; },
function(user) { return user.userName; }
];
looking for early response