Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieve values specific to a row  RSS feed

 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'am displaying a table in a jsp with different with a button in each row with the same value. I' am calling all the action in the servlet. Now on submit I need to update the rows in the database and the page. i' am passing a hidden field with the id of each row after every button in the jsp. When i call the action in the servlet, it is taking the id of the first record and updating it. I' am unable to call the action on a specific record and update it. Please help me how to do it.

Thanks in advance,

regards,
Komal
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give the button the value that represents the id for the row.
 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

That dosen't seem possible. As the value is what that is displayed in the page. I tried passing the value to the name and id attributes, but even that was not helping as request.getparameter needs to specified to call an action and it was not possible to retrieve the value prior to the action, but I used js to pass the value onclick to the form calling the value on action in the url. That worked.
Thanks a lot.

regards,
Komal
 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes, though I could use js to resolve it, I still would like to know if there is a way to do it on the server side.
I tried the following way.

The above code in the jsp when called in the servlet is retieving the first record's id.
I doubt passing an int to the name of the button will help as follows.
In the jsp, I set the values as follows.

In the servlet....


How can I do it?

thanks and regards.
Komal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!