am using <html:multibox> with LabelValueBean. the following is the code
<logic:iterate id="IDRequirement" name="InitialPageDetailViewBean" property="IDRequirements"> <html:multibox property="IDRequirementValues"> <bean:write name="IDRequirement" property="value"/> </html:multibox> <bean:write name="IDRequirement" property="label"/> </logic:iterate> The above code is rendering me all checkboxes with appropriate values. What i am trying to achieve is to make some of this checkboxes Checked based on a list. I am wondering if there is a straight forward way of doing it by passing my list as part of value in Multibox property.
Can any one suggest, how i can do this. I will really appreciate any help as i am nearing a deadline.....
I am now facing to a case that, when the value of the checkboxes is empty string, all boxes are checked.
But somehow the checkboxes really should not have any values, so, any method that I can have the empty value checkbox, but the checkboxes are NOT checked by default?
If you are using DynamicActionForms, and you are using <html:multibox> where having no boxes checked is a valid state, then you must exten org.apache.struts.action.DynamicActionForm and override reset(), setting your String to a new String of size 0.