>The enhancement is not in any way limited to labels.  Every input type
>(checkboxs, text boxes, textareas, etc...) would benifit from the same
minor
>>code change to the BaseHandlerTag.  Once this change was made, all the
>end-developer would have to do is set up styles/error styles in a
properties
>file (whichever one they want).  There would be zero change to how the gui
>developer would use the struts custom tags.

What I meant by my earlier comment is that I had requirements other than
being able to style labels based
on errors. Such as placement of error messages. Being able to place error
messages between rows of a form requires you to either have alot of control
over the overall form construction, use a bunch of logic tags intermixed
with form fields.

>A main idea behind custom tags is to encapsulate complicated java code so
>the gui developers dont have to worry about it.  IMHO, asking gui
developers
>to start writing XSLT is equiv to putting that straight java code back in
>the pages.

I'm aware of the design goal of tags to encapsultate that type of code, but
I disagree
that's it's akin to scriptlets (java code on page). It's just another
templating language, it
also uses elements (which are tags w/o backing Java code) like JSP tags.

As requirements grow, tags can grow and out-live there original purpose. I
felt XSLT provide a nice way
out of having to extend (or create anew) a tag for a single requirement when
I had others that had
to be met.

>I think straight html is always gonna be the way to go here.  I don't see
>the benifit to saying 'put my error message after this label' or 'put my
>message after this input field'.  I think that is too much control and is
>better left to the developer to put that <html:errors> tag where they want
>it.

In my case it is just the right amount of control. Requirements drive where
the labels and error
messages go w/regards to making the screen as usable as possible. I don't
get to decide in many
cases where these types of things appear on a screen.  I'll agree that XSLT
enables
alot of control over the form, but writing XSLT templates is not that
different from
writing a snippet of JSP with a set of JSP tags.  In this particular case
though, given the
set of requirements I had, this was the most flexible way to meet it.


-----Original Message-----
From: DeRose Jonathan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:43 PM
To: Struts Developers List
Subject: RE: Form field styling/error reporting - Alternate solution
[Long]


>That's great if all I was worrying about was the label.  I also don't think
>styles should necessarily be put in property files, formatting /
>presentation information should be kept as it's own resource, separate from
>the data it's applied to.

The enhancement is not in any way limited to labels.  Every input type
(checkboxs, text boxes, textareas, etc...) would benifit from the same minor
code change to the BaseHandlerTag.  Once this change was made, all the
end-developer would have to do is set up styles/error styles in a properties
file (whichever one they want).  There would be zero change to how the gui
developer would use the struts custom tags.

I don't care (nor to i want to limit) which bundle the user wants to store
the style info in. But I do feel putting it in a bundle is the way to go.
Being able to give locale specific error styles will always be more helpful
than locking the user into a single set of styles.

>I don't have a problem with how the current Struts form tags are
>implemented, but when you take a form as a whole, and mix in
>formatting/layout/presentation,etc info that might be replicated from JSP
to
>JSP, couple with a desire to make non-engineers responsible for maintaining
>them (w/o writing Java code). Using something as flexible as XSLT was a
>better solution than trying accomplish the same with a set of changes to
JSP
>tags.

A main idea behind custom tags is to encapsulate complicated java code so
the gui developers dont have to worry about it.  IMHO, asking gui developers
to start writing XSLT is equiv to putting that straight java code back in
the pages.

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

>Yes, but I'm not changing those descriptions, I'm merely providing more
>control over how you can place them relative to the field they are for, as
>well as the style that is applied to the label or field associated with the
>error.

I think straight html is always gonna be the way to go here.  I don't see
the benifit to saying 'put my error message after this label' or 'put my
message after this input field'.  I think that is too much control and is
better left to the developer to put that <html:errors> tag where they want
it.

Jonathan




-----Original Message-----
From: DeRose Jonathan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 11:02 AM
To: Struts Developers List
Subject: RE: Form field styling/error reporting - Alternate solution
[Long]


>-----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]



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




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



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

Reply via email to