• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in Editing Table Data

 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to edit some data in a table. The database result appears in the table (with a check box next to each row) but when I click on the check box this exception occurs :




Here are my source codes :

TableData.java :




UserBean.java :




Please tell me what I should do.

Thanks in advance,
Maryam
 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
editUsers.jsp :


[ June 12, 2007: Message edited by: Maryam Nouhnejad ]
 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please somebody help me!
 
Gabriel Claramunt
Ranch Hand
Posts: 375
Monad Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the exception:
SEVERE: Error testing property 'fullName' in bean of type null

Somehow, when you are iterating over the collection, you have a null userBean.
Probably you need to do some debugging...
[ June 12, 2007: Message edited by: Gabriel Claramunt ]
 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could solve my problm. Actually the number of rows in database was 26 but when I counted the number of rows printed in the web page I saw that it's 78 (26*3)...it was related to my array data; when I corrected the SIZE_USERS to :

and added them to my code (TableData.java) under


It worked and there were no more exceptions.



Now, I can edit the user information in the web page but how can I add the changes to the database? ... I mean if I have a submit edit button for all rows, how can I check which rows were changed?


Please guide me!

Thank you,
Maryam
 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me for the last question!

Thank you!
 
a
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
bind the dataTable to a HtmlDataTable attribute to get the selected row. Here a link how you can solve this problem: BalusC-Link
 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the link!

I read it and added the code to my project.

Now I have a column like this & I want to save the changes (after editing) to database :



but first I want to be sure the saveEditedRow can be called.


These are the methods I added to my TableData.java :




... but nothing happens. There is no exception and nothing is printed in my console. Do you know why?
 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea is appreciated!

 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me!!
 
Maryam Nouhnejad
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could solve my problem.
The problem was that I should write

instead of


Maryam
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!