(I am reposting this message from a few days ago, because I realized that  my original post was a reply to another message, and that even though I had changed the subject line, perhaps tree-viewing mail clients would show it is part of another conversation, which I didn't really intend. I just wanted a shortcut to entering "[EMAIL PROTECTED]").


I am working wth ActionForms, one of which contains some list boxes and some checkboxes. In building my ActionForm class, I am noticing in the docs (under "Form Construction Tags") warnings like the following:

WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method.
WARNING: In order to correctly recognize cases where no selection at all is made, the ActionForm bean associated with this form must include a statement resetting the scalar property to a default value (if multiple is not set), or the array property to zero length (if multiple is set) in the reset() method.


So, in my reset() method, I am putting default values for these properties, as recommended.

However, I am noticing that in the "first pass" of loading a JSP page (before any Action has occured), my ActionForm bean's reset() method is not being called; only it's constructor is being called. So, the logic I put into the "reset" method, I copied into my default constructor as well.

It seems to me that one of the following should happen:

1. The default constructor should call the reset() method.
2. The docs should be updated to indicate that, if you are going to put default values in your ActionForm, you better set them from your default constructor as well as from your reset() method.

Comments?

Bryan




Reply via email to