Hi Erik, 

Thanks for the response, Yes, your implementation looks
Better than mine and the idea of turning 'fields in error
red' is also nice, that's what I wanted to know if there
Is already anything like this going, Hope this tag is 
added to Struts soon.

Also, just a query, Does your tag extend MessageTag ?
Is it a good idea to do that ?

Thanks,
Vaibhav

-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 24, 2003 5:36 PM
To: Struts Developers List
Subject: Re: A Custom tag using <bean:message /> and validation ...


I wrote a tag that will do the '*' thing, and also turn the fields a 
different color if they are in error, along with a few other goodies.

There is an open issue for something similar to be added to the Struts 
codebase here:

        http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18015

See the link to Matt's variation of what I originally wrote and see how 
it compares to what you did.  I agree that more in this area is needed. 
  Mine is a bit less verbose than yours:

        <custom:label key="FormName.fieldName"/>

Field labels are in our resources by that key, and by breaking that key 
up a little it figures out the rest from the validator metadata and 
ActionErrors collection.  Even the FormName is a bit redundant since 
its always nested in an <html:form> and thus the form name could be 
gotten from that parent tag (but would be confusing for developers 
later looking at the JSP trying to figure out which key its using since 
you'd have to look at struts-config to figure out the form name).

        Erik


On Tuesday, June 24, 2003, at 05:52  PM, Ranjangaonkar, Vaibhav (HQP) 
wrote:

> Hi all,
>
> I have written a custom tag by extending MessageTag from taglib.bean 
> to display a * after a label. This * should be displayed after the 
> label if the corresponding property is specified as 'required' in 
> validation.xml
>
> Example :
>
> <valid:label key="label.firstName"
>              property="firstName"
>              formName="subscribeForm" />
>
> I can post the code if needed, just wanted to know if there is already 
> something like this or can this tag be improved.
>
> Thanks.


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

Reply via email to