• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with getRowData of ListDataModel

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You can't have everything. Where would you put it?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic