It's a consequence of the HTML standard. It does not represent unchecked checkboxes. You can hardly call it a bug of struts.
And I don't think you should force your users to use java-enabled browsers if you can do it otherwise. My € 0,02 tomK > -----Original Message----- > From: Linnea Ahlbeck [mailto:[EMAIL PROTECTED]] > Sent: maandag 17 december 2001 20:48 > To: Struts Users Mailing List > Subject: Re: Checkbox's question. > > > Hi!! > > I think it's a bug... > > Javascript is funny but it slows down the prestanda a lot.... > > /Linnéa > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, December 17, 2001 8:27 PM > Subject: RE: Checkbox's question. > > > So it is the way supposed to be or just a bug of struts? > > -----Original Message----- > From: Dan Cancro [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 17, 2001 1:41 PM > To: 'Struts Users Mailing List' > Subject: RE: Checkbox's question. > > > I was just thinking about this problem, too. I think this > checkbox-in-request-only-when-checked anomaly should be handled with > javascript like this: > > The checkbox jsp tag should create a hidden field named after > the property, > and a checkbox with some other name. When the checkbox is checked or > unchecked, it should change the value of the hidden field > with a generated > line of javascript. > > This way, the controller doesn't have to know that the field > is rendered as > a checkbox (and do this special checkbox jig), and the > field's value is only > changed when the field exists in the request. So if another > jsp doesn't > have the checkbox at all, the value isn't touched. > > Dan > > > -----Original Message----- > > From: Linnea Ahlbeck [mailto:[EMAIL PROTECTED]] > > Sent: Monday, December 17, 2001 10:29 AM > > To: Struts Users Mailing List > > Subject: Re: Checkbox's question. > > > > > > Hi!! > > > > All values from your formbean are sent in the request as > > parameters when you > > press submit - but checkbox values are only in this request > > if they have the > > value on = they are checked. If you use the reset method it > > should work in a > > correct way - values are first set to false by the reset > > method and then, > > if they are present i the request they receive value true, > > otherwise the > > have the value false. /Linnéa > > > > > > > > ----- Original Message ----- > > From: <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Monday, December 17, 2001 7:07 PM > > Subject: RE: Checkbox's question. > > > > > > coincidentally, I was working on the check box today for the > > first time. I > > found the problem too. > > It seems OK when you set the check box "unchecked" as defaut > > (openWindow=null;). but when you set it "checked" as default, > > each time you > > uncheck the box and submit. the value won't change, it > still remained > > checked. In fact. the setOpenWindow(..) function has never > > been called when > > the box was unchecked. It is only called when the check box > > is checked. > > Any one knows what went wrong? > > > > Thanks > > > > Yunming Li > > > > -----Original Message----- > > From: Linnea Ahlbeck [mailto:[EMAIL PROTECTED]] > > Sent: Monday, December 17, 2001 11:51 AM > > To: Struts Users Mailing List > > Subject: Re: Checkbox's question. > > > > > > Hi! > > > > Use the reset method in the form bean: > > > > public void reset(ActionMapping mapping, HttpServletRequest > request) { > > openWindow= false; > > } > > > > This is a well known problem, see link: > > http://www.jguru.com/faq/view.jsp?EID=471957 > > > > Good luck / Linnéa > > > > > > ----- Original Message ----- > > From: "Hong Xing" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Monday, December 17, 2001 4:05 PM > > Subject: Checkbox's question. > > > > > > Hi all, > > I am a newbie. > > I used <html:checkbox> in my work. But it worked strange. When I > > first view the page and submit the form, the checkbox is > OK. Then if I > > view the page again and change the checkbox's state, the > > checkbox is not > > ok. It's always checked. How to fix it? > > <html:checkbox property="openWindow" value="on"/> > > > > public void setOpenWindow(String openWindow) > > { > > this.openWindow=openWindow; > > } > > public String getOpenWindow() > > { > > return openWindow; > > } > > private String openWindow="on"; > > > > Please help me!!! > > > > Sincerely, Hong Xing > > > > > > ============================== > > Bioinformatics Department > > Beijing Genomics Institute > > Beijing Center > > Beijing Airport Industrial Zone B6 > > Beijing 101300 > > Tel: 0086-10-80494199-3306(Office) > > Email : [EMAIL PROTECTED] > > ============================== > > > > > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: > <mailto:struts-user-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>