jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes List of dinamic checkboxes, how to get values, reflection of properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "List of dinamic checkboxes, how to get values, reflection of properties" Watch "List of dinamic checkboxes, how to get values, reflection of properties" New topic
Author

List of dinamic checkboxes, how to get values, reflection of properties

Moli molina
Greenhorn

Joined: Apr 07, 2010
Posts: 19
Hi at all,

I have a question, about getting the values of a dinamic list of checkboxes.
I have a list of objects, and these objects have a list of checkboxes.
I print the checkbox on a jsp :


The name of the list of checkboxes is dinamic. How I do to get the values at the action ?

It's good practice?
Thanks!
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

From what I could understand from your code, instead of check_%{organ} use check['%{organ}'], that way you can catch all the selected checkbox into a HashMap in the action...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Moli molina
Greenhorn

Joined: Apr 07, 2010
Posts: 19
Many Thanks for quick reply!

It works!

Jose
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: List of dinamic checkboxes, how to get values, reflection of properties
 
Similar Threads
Need to create dynamic <s:property tag using <s:iterator
Data mismatch between two separate lists in a single iterator in struts2
Sticky nested lists problem in Struts 2
How to get Iterating value in a list of VO struts2
struts 2 example to have a link in one of the Iterated value in the JSP and pass it to an action