struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Means" <>
Subject Checkbox state not changing after "checked on"
Date Sat, 23 Feb 2002 21:49:48 GMT
I'm having a problem with setting check box states on my form.

I have a checkbox on my form, it's supposed to be "checked" if muting is
occurring, and not checked otherwise.

The user just needs to click the checkbox to change/toggle the state.

However, I only seem to get an Action setting if the checkbox is not
checked...any ideas what I'm doing wrong?  Shouldn't the property be set
regardless of the state of the object?


        <html:checkbox property="mute"
                       onclick="this.form.submit ()" />Mute

My FormBean:

  public void setMute (boolean newMute)
    mute = newMute ;
    action = "mute" ;

My ActionForm:

    ControlPanelForm cp = (ControlPanelForm) form ;

    String action = cp.getAction () ;

    System.out.println ("Action: " + action) ;

    if ("mute".equals (action))
      api.mute () ;

    status.refresh () ;

    cp.setMute (status.isMuted ()) ;

    return (mapping.findForward ("success"));



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message