Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt about storing selected checkboxes in formbean

 
Raveendra Mutyala
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case, create a property named "damage" of type String[] in your ActionForm bean with a corresponding getter and setter.
 
Attractive, successful people love this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!