I took my enhancement a step farther today and set it up to work with the
ResourceBundle.  With this new implementation it is possible to set the
default styles you want to use once for the entire application.  With this
new implementation, you can set the styles to use in one place.  Before, you
would have to either 1)extend the tag library or 2)put the style attributes
in each and every tag.

I set it up so you can set default values to use for the following tags:
checkbox, label(new), multibox, password, radio, select, text, & textarea

The default values you can set are:
style, styleClass, styleId, errorStyle, errorStyleClass, errorStyleId

Example:
===== ApplicationResources.properties =====
errors.header=Errors Start:<ul>
...
...
LabelTag.errorStyleClass=invalid_label
LabelTag.styleClass=valid_label
...
TextTag.errorStyleClass=invalid
TextTag.styleClass=valid
...
...
===== test.jsp =====
<html:label property="name">Name:</html:label><html:text property="name"
size="10" />

===== output (if there IS an error on the name) =====
<SPAN class="invalid_label">Name:</SPAN><INPUT type="text" name="name"
class="invalid" size="10">

===== output (if there IS NOT an error on the name) =====
<SPAN class="valid_label">Name:</SPAN><INPUT type="text" name="name"
class="valid" size="10">

If you set your own style attributes they would override the defaults set in
the resource bundle:
<html:label property="name" styleClass="myStyleClass"
errorStyleClass="myErrorStyleClass">Name:</html:label>
<html:text  property="name" styleClass="myStyleClass"
errorStyleClass="myErrorStyleClass" size="10" />

I have the code working, but I wasn't sure if I was suppose to update the
current enhancement ticket or close it and create a new one...
-Jonathan



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to