permaculture playing cards*
The moose likes Struts and the fly likes problem with getRowData of ListDataModel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with getRowData of ListDataModel" Watch "problem with getRowData of ListDataModel" New topic
Author

problem with getRowData of ListDataModel

daniel cs leung
Greenhorn

Joined: Nov 01, 2004
Posts: 1
Dear all,

I feel nervous with the following issue of the getRowData() in ListDataModel. Pls kindly help.

In the bean, there is a property, called "user_list" (ListDataModel), storing the latest result of users from database. Also, there is a property, called "user" (User), storing selected user informaion.

prepareModifyUser() function will update "user" with the selected row of ListDataModel.


public ListDataModel getUser_list() {
return this.user_list;
}
public String prepareModifyUser() {
String fail_msg = "prepare_modify_user_fail", success_msg = "prepare_modify_user_success";
String status = success_msg;
User user = (User)getUser_list().getRowData();

try {
setUser(new User(user.getId()));
} catch (Exception e) {
Logger.log("UserRegistry.prepareModifyUser", e.toString());
status = fail_msg;
}

return status;
}


It is working well to show the list of user on the DataTable. Also, it is sucessfully to call "prepareModifyUser()" by clicking the link on the table, and go to the modify_user page and show all user information.

After the user saved the updated information , the page will be redirect to a modify_user_success page. There is a [back to list] button and [modify again] button only.

When I click the [modify again] button, the system should call prepareModifyUser() again and go to the modify_user page. But, it is fail and there is java.lang.IllegalArgumentException shown. I am sure that I haven't reseted the "user_list".

I am wondering if the cursor in the ListDataModel will be resetted after calling another page? Can anyone help me. Thanks a lot.

brgds,
Daniel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with getRowData of ListDataModel
 
Similar Threads
getting object instance inside nested h:dataTable
ibm websphere test 157 for websphere studio application developer 4.0.3 for windows
IBM 157 ICE Sample Exam Answers
157 Question Help and Resourses
IBM Exam 157 - Questions and Answers (Sample Exam)