I think this is a problem in Struts. One way I know to work around the problem is to get the checkbox value from the request parameter and then use logic in your Java code to check the value of the checkbox property being returned in the parameter and then setting the property of ur checkbox in the bean.
e.g. String checkValue = request.getParameter("[checkBoxProperty]");
if(checkValue.equals(true)){ }
Zip Ped
Ranch Hand
Joined: Jul 26, 2005
Posts: 336
posted
0
I think this is a problem in Struts. One way I know to work around the problem is to get the checkbox value from the request parameter and then use logic in your Java code to check the value of the checkbox property being returned in the parameter and then setting the property of ur checkbox in the bean.
e.g. String checkValue = request.getParameter("[checkBoxProperty]");
Hi, Struts have one problem as it will send value to form bean only if the check box is selected. For overcoming this issue,in java script u need to give the value externally.
For exmp. if(document.forms[0].preselected.checked){ document.forms[0].preselected.value="true"; }else{ document.forms[0].preselected.value="false"; }
Where as preselected is the field in form bean, which we are using with check box name also, like