I'm using the SimpleFormController and have checkboxes in the view. When the form is submitted the values of the checkboxes are correctly binded to the bean. But when the form (jsp view) returns from the onSubmit method the checkboxes are not checked. I've tried doing the following things : -
<input name="location" description="xyz" type="checkbox" id="location-filter-1" style="float:left" value="1"/><input name="location" description="xyz" type="checkbox" id="location-filter-1" style="float:left" value="1"/> <input type="hidden" name="_location" value="visible"/><springbind:bind path="location"> <input name="location" description="chennai" type="checkbox" id="location-filter-1" style="float:left" value="1"/> <input type="hidden" name="_location" value="visible"/> </springbind:bind>
I've had no luck in getting thoses checkboxes checked. Could any one suggest a work around for this.
In the bean, an Integer array is used to hold the values for checked checkboxes :-
private Integer[] location;
The checkboxes are currently like this:- the checkboxes are arranged like this
<ul>
<li class="x">
<span>text</span>
<input type="checkbox" value="1" id="location-1" name="location"/>
</li>
<li><span>text</span>
<input type="checkbox" value="2" id="location-2" name="location"/>
</li>
<li>...</li>
..
</ul>