Browsers only transmit values when the checkbox is "checked" - in the reset
method of your ActionForm set the "lockedFlag" to the false value.
Niall
----- Original Message -----
From: <[EMAIL PROTECTED]>
Sent: Thursday, February 23, 2006 9:22 PM
> I have problem with checkbox property not communicating with my Action.
> I have String property with "Y"/"N" in FormBean populated from DAO , I
> convert it to "yes"/"no" before sending it to form and I do conversion
> back from "yes"/"no" to "Y"/"N" after I receive from form and send it to
> DAO.
> What is missing here ?
> Pls. Help !!
>
> In my FormBean it is String element
> as under
>
> public class InstrumentForm extends ActionForm {
> ....
> private String lockedFlag;
> ....
> }
>
>
>
> My jsp lines for checkbox is as follows:
>
>
>
> <td class="tdLabel"><fmt:message key="label.lockedFlag"/>:</td>
> <td><html:checkbox property="lockedFlag"
> value="${lockedFlag}"/></td>
>
>
>
>
>
> As my dao returns "Y" or "N"
>
> I do following conversion when I send data to form.
>
>
> public ActionForward setUpForInsertOrUpdate(ActionMapping mapping,
> ActionForm form, HttpServletRequest request, HttpServletResponse response)
> throws Exception {
>
> InstrumentForm instForm = (InstrumentForm)form;
>
> if (instrument.getLockedFlag().equalsIgnoreCase("Y"))
> {
> instrument.setLockedFlag("yes");
> }
> else
> {
> instrument.setLockedFlag("no");
> }
> BeanUtils.copyProperties(instForm, instrument);
> }
> prep(request,initMap);
> return mapping.findForward(Constants.SUCCESS);
> }
>
>
> On its way back from form I do following conversion
>
> public ActionForward insertOrUpdate(ActionMapping mapping, ActionForm
> form, HttpServletRequest request, HttpServletResponse
> response) throws Exception
> {
> InstrumentForm instForm = (InstrumentForm)form;
> if (instForm.getLockedFlag().equalsIgnoreCase("yes"))
> {
> instForm.setLockedFlag("Y");
> }
> else
> {
> instForm.setLockedFlag("N");
> }
> instService.updateInstrument(instrument);
> }
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]