Erik,

You might want to have a look at the struts-layout taglib hosted at 
http://struts.application-servers.com
This opens source library implements (nearly) all the functionality you 
described here, and much more !

If you intend to share your code, I'm very interesting in the part checking 
if a field is required in the validator resources.

Regards,

Jean-Noel


At 02:52 15/10/2002, you wrote:
>I implemented something that I think is relatively slick today, so I 
>thought I'd share the idea.
>
>First, a change was requested to suffix all our field labels with 
>colons.  We already had this structure:
>
><th><bean:message key="SomeForm.someField"/></th>
><td><html:text property="someField"/></td>
>
>I created a LabelTag taglib that (currently, but not necessary) subclasses 
>MessageTag.
>
>It, of course, satisfies the request to suffix with a colon such that our 
>message resources (now in the database) are not changed, and the JSP does 
>not have colons.  But, I figured why stop there, so I dug through 
>ValidatorResources and added in an asterisk if the field is required, and 
>then dug through ActionErrors and turned the field red (using CSS classes 
>and a <span>) if the field was in error.
>
>This is a feature I've been thinking of for a while, and I'm sure others 
>have implemented similar features, but its such a big enhancement that I 
>felt like sharing it!
>
>I'm not sure if this is worthy of making more generic and contributing 
>though.  Thoughts?  Its dependent on your forms subclassing ValidatorForm 
>and validation.xml be used appropriately, and it also relies on field 
>labels adhering to the <form name>.<field name> syntax and be stored in 
>the message resources.
>
>         Erik
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>


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

Reply via email to