Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple record updation

 
Venkata Sirish
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In jsp iam displaying, 100 records . Iam displaying a check box for each record. It is a delete functionality. I will check the corresponding records checkbox which are to be deleted.

How can i handle this functionality... how can i get the list of users who have been checked to be deleted, in the backend (Java Action class).

Please explain me in detail .... ASAP

Thanks in Advance,
Guru
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"VenkataGuru Mitta",
Please check your private messages.
-Ben
 
Schandha Ravi
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Venkata,

You can always get the value of your checkbox in your controller using req.getParameter(<param name>) if this function returns "On" that means that checkbox is selected. Check www.w3schools.com for further information on these controls.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, when you want to get checkboxes, since there can be more than 1 checked, you need to be able to get back an array of those values. So you'd need something like:

String[] users = request.getParameterValues('whateverNameYouGaveTheHTMLElements');

That being said, I also noticed you mentioned "java Action class" and when I see folks say Action I think a framework might be involved. If this is true, while my suggestion above is still valid, there may be a different/easier/harder way to do it using the framework. You'll just need to let us know.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic