problem with DWRUtil.addRows function unable to see user info in table

View: New views
1 Messages — Rating Filter:   Alert me  

problem with DWRUtil.addRows function unable to see user info in table

by ganesh pol-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi ,
This is ganesh i am facing some problem in displaying user information in jsp with dwr framework
 
JSP  CODE
here is my part of jsp with select  which onchange calls js function

<html:select property="userIdentification" onchange="getUserDetail()">

         <html:option value="-1">

              Select Users...

            </html:option>

          <logic:notEmpty name="users">

              <html:options collection="users"

                                   property="userIdentification"

                                   labelProperty="firstName" />

         </logic:notEmpty>

</html:select>

part of my jsp which will show information of user in table

<div id="userTable">

<table>

<thead>

<tr>

<th>First Name</th>

<th>Last Name</th>

<th>Username</th>

</tr>

</thead>

<tbody id="user">

</tbody>

</table>

</div>

 

JAVA SCRIPT CODE

function that will get called on onChange event

/**

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

 


--
with warm Regards from
Ganesh Pol


--
with warm Regards from
Ganesh Pol