*
The moose likes Struts and the fly likes doubt about storing selected checkboxes in formbean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "doubt about storing selected checkboxes in formbean" Watch "doubt about storing selected checkboxes in formbean" New topic
Author

doubt about storing selected checkboxes in formbean

Raveendra Mutyala
Greenhorn

Joined: Sep 10, 2005
Posts: 13
hi friends,

i had been converting the html pages to struts i had been facing a problem that is, I can select(check) so many checkboxes and all are having the same name (as they belong to group) . i wanted to store all the checkboxes which are selected in the form into the form bean. if i had written a formbean it is just storing only the first check box which is being selected if i accept it with a string type setter method in the form bean.
how can i do this.



Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In this case, create a property named "damage" of type String[] in your ActionForm bean with a corresponding getter and setter.


Merrill
Consultant, Sima Solutions
 
Don't get me started about those stupid light bulbs.
 
subject: doubt about storing selected checkboxes in formbean
 
Similar Threads
How to get Names of selected checkboxes?
save checked value in checkbox to database
Need Help with binding click events to table rows
geting focus on radio button
How to validate that in each row how many checkboxes are checked