You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Snyder <ss...@flashpoint.com> on 2001/03/09 18:38:34 UTC

Getting id attribute in the HTML tags?

Is it possible to get the id CSS attribute generated within the html custom
tags available within struts? From what I can see you can only get the style
and class attributes generated using the style and styleClass attributes on
the html custom tags.

Thanks,

Scott

Scott Snyder
Flashpoint Technologies
Senior Staff Software Engineer
ssnyder@flashpoint.com


Observations on ActionForms, reset(), tags

Posted by Bryan Field-Elliot <br...@netmeme.org>.
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