You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Sann, Stephan" <SS...@bhw.de> on 2002/09/04 15:07:22 UTC

Bugreport(?): html:checkbox

Hello List,

I think I found a bug in the "html:checkbox"-Tag. Anybody who can confirm?

This is from my formbean-class:

      private boolean einTrefferJeHaushalt = true;

      public void reset(ActionMapping mapping, HttpServletRequest request) {

        [...]
        this.einTrefferJeHaushalt = true;
        [...]
      }
    

This is my Tag:

    <html:checkbox property="einTrefferJeHaushalt" value="yes" />


The formbean is in the session-context.
Because I set the boolean to "true" the produced checkbox is checked by default -
that's exactly what I've expected.

But: If I uncheck the checkbox, go the next site and return to the checkbox-site,
the checkbox is checked again!


You may think there is something wrong with my session, but it is not. If I change
the formbean-class to:

      private boolean einTrefferJeHaushalt = false;

      public void reset(ActionMapping mapping, HttpServletRequest request) {

        [...]
        this.einTrefferJeHaushalt = false;
        [...]
      }

... the whole thing works (it keeps the status of the checkbox all over the session,
even the status is checked or unchecked).


Unfortunately I need a default-status of "checked", so I can't use the second solution.


Any ideas, comments, confirmations?


Thanks a lot!
Stephan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>