Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usage of html:checkbox for Multiple Entities

 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a scenario in which there are multiple checkboxes in the same page belonging to one logical entity(Say Hobbies with multiple options given to choose in the form of Checkbox Group).

Now in my ActionForm(Bean)i am using one get and set method with String[] as dataType.

So when the user selects multiple hobbies and clicks Submit, values gets filled properly . But during the modification scenario (like i set the hobbies to the form bean), the appropriate hobbies are not getting selected automatically though i used html:checkbox tag.

Is it that checkbox tag is not handling for Array of Values ??
 
Tim Storms
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use the html:multibox tag.

For example:


You can now catch all the values in a String array in your form bean.

You also wanna check Struts Multibox Tag
[ June 30, 2006: Message edited by: Tim Storms ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic