Thanks a lot , you have been very clarifying.

I've found a tip placing code in validate method :

public ActionErrors validate( ActionMapping mapping, HttpServletRequest req) {
String str = req.getParameter( "isOn" );
if (str == null)
isOn = false;
return null;
}

But it's a very dirty technique of course.



Wendy Smoak wrote:

I'm coming into this discussion late, so ignore me if I'm out in left field,
but it sounds like you're unhappy that when *no* checkboxes are checked,
*no* methods get called.

When you submit the form, only "successful" form elements are sent in the
request, so if *no* checkboxes are checked, *nothing* related to those
checkboxes will be present in the request.

Isn't this what the "reset" method is all about? The reset method will be
called before Struts automagically populates all of your ActionForm fields.
I can't tell what your Collection is from this post, but try clearing out
*all* of the values in the Collection that handles your checkboxes in the
reset() method of the Form.

Then, if you uncheck all of the boxes and submit, you should see that none
of them are checked when the form is redisplayed (or you use the data).

Hope that helps,

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to