File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes dataTable troubles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable troubles" Watch "dataTable troubles" New topic

dataTable troubles

Brian Smith
Ranch Hand

Joined: May 20, 2005
Posts: 63
I have been struggling with creating an edit form out of a dataTable for a while. What I have is a datatable with output boxes and some commandLinks. When you click on one of the commandLinks the row of the data table changes from output to input allowing for a database update. There is also a save button to save the change. There are two steps to editing a record.
1. Click the edit link
2. Make the change and click the save link.

Step 1 is behaving correctly as far as I can tell but once you try to update the record, the changes made by the user are somehow being over-written by the original data from the List that feeds the datatable. I am sure I am just doing something stupid.

Here is my jsp

Here is the backing bean

The backing bean AccountBacking is in the request scope. I don't want to make it Session scope if at all possible.
The outputAcct private method is just for debuggin purposes.
Brian Smith
Ranch Hand

Joined: May 20, 2005
Posts: 63
Here is a screen capture of the two screens

Step 1:

Step 2:
vishwa venkat
Ranch Hand

Joined: Nov 22, 2003
Posts: 185
After saving data, call setAccountList passing new account list. I am not sure, this might solve your problem. what I see is, after save method is called the component is not updated to show new accounts list. Try and let me know.
I agree. Here's the link:
subject: dataTable troubles
It's not a secret anymore!