>-----Original Message-----
>From: Mike Jasnowski [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 25, 2003 9:55 AM
>To: Struts Users Mailing List
>Subject: Form field styling/error reporting - Alternate solution [Long]

>The technique centers around the use of XSLT to process what appears
between
>the start and end <form> tags.  The project I'm working had a similar
>requirement of being able to highlight field labels, also possibly
highlight
>the field itself, as well as place a custom error message above the row. We
>also wanted to allow flexibly layout and formatting of the form elements.
> An initial reaction might be to create a set of form tags that were
>knowledgable about form errors and provided means to style based on form
>errors. If this meets your requirements then that's all well. But if you
>wanted to apply this style to fields themselves, then you might end up
>adding this feature to all form element types.  Additionally, the placement
>of field level error messages at a location not directly after the field
>while maintaining the flexibility to layout and present the other field
>elements complicates this somewhat.

The BaseHandlerTag currently controls what styles tags use to
display themselves. Making a small modification to the prepareStyles()
method will get you control over every input type there is.  In addition,
by creating a new LabelTag that extends BaseHandlerTag, it is covered under
the changes as well.  If you set up what styles/error styles to use in the
resource bundle, page developers get all of the error handling
functionality with no changes to the jsps they write.

As far as the text descriptions of the errors, this is already handled by
<html:errors property=""/> really well.

Jonathan



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

Reply via email to