mmm I'm using Struts 2 (struts2-core-2.1.6) and the last checkbox (of a checkbox array) doesn't get unchecked, as I have previously commented...
WHY? It seems it has to be always selected one of the checkboxes at least 2010/2/23 Robert Graf-Waczenski <r...@lsoft.com> > lucas owen schrieb: > > Hi struts users, >> >> I'm working with a checkbox array; the problem is that it doesn't work as >> a >> single checkbox: I can't have the checkbox array with all checkboxes >> unchecked (apart from the beginning) >> >> Example: >> >> I check checkbox1. >> I check checkbox2. >> I uncheck checkbox2 --> OK >> I uncheck checkbox1 --> checkbox1 doesnt get unchecked >> >> Is this working as normal or I'm performing wrong??? >> >> Thanks in advance >> Peter >> >> >> > This should work correctly out of the box with Struts2 because there are > interceptors and hidden parameters that work the magic for you. In Struts1, > there is no such magic and the behavior you describe is normal because if > none of the checkboxes is checked, then the resulting browser request does > not contain the corresponding request parameters *at all*, meaning that your > server-side state is unchanged. Solution: Implement the ActionForm.reset() > method to deal with this properly, i.e. reset your form values to null (or > whatever) when the request parameters are missing. > > Robert > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >