Hi,
  I think Struts should be as flexible/extensible as is possible/practical.
With that in mind, and after reading about this enhancement I have the
following concerns:

1) Putting an '*' into a label for required fields assumes people want an
'*', maybe they want a '(R)' or maybe they want something else entirely
(perhaps an image...).

2) Putting an '*' after a label for required fields assumes people want an
'*' after the label.  Perhaps they want the '*' before the label or after
the actual input field.  Consider the label 'Name:' with three text boxes
for first, last, and middle.  First and last might be required but middle is
not.  There is no clear way to mark first and last but not middle with this
enhancement.

3) Forcing people to use the ResourceBundle to display labels requires a lot
more effort for applications that have no internationalization requirements.
For many web applications, html text is enough and does not require a heavy
resource bundle to maintain or keep in memory.

-------

If there is a strong desire for an asterisk tag, why not just have a tag
that takes a property and prints out an asterisk if it is required?

Or even better, set up whatever symbol you want to show for required fields
in the resource bundle, and then use that. <html:required
property='form.element' />

EX: ApplicationResources.properties
html.required=*
-or-
html.required=(R)
-or-
html.required=<IMG SRC="./required.gif">

-------

I have proposed an enhancement that I think offers more flexibility from the
error handling perspective:
* It allows for error styles, error classes, and error ids for labels AND
for all of the input elements.  (You could make the label 'Name:' red and
bold, or you could make the name text box highlighted in red, or both)  It
allows developers to set up these styles once in the ResourceBundle and be
used over the entire application
        html.text.styleClass=text_input
        html.text.errorStyleClass=red_text_input
* It allows you to group errors (a single error for 'SSN' can make the
'SSN:' label bold and highlight all three text inputs).
* The label tag wraps whatever specific label you want to use, whether it is
a message from the ResourceBundle or just plain HTML.

It does not handle pre-marking required fields--however I don't think any
output should be hard-coded into Struts, where a modification of the tag
(see above) to a more general one would do the trick and be a good addition.

I feel this offers the kind of flexibility and extensibilty that I think
Struts needs.
Please check out this enhancement at
http://issues.apache.org/bugzilla/show_bug.cgi?id=20784

Thanks,
Jonathan

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


> Even if its not added to Struts (and there is a reason not to - it
> relies on naming conventions FormName.fieldName - which seem reasonable
>
> to me, but aren't mandated by Struts), its all yours to use.  It makes
> sense to put it in some kind of sandbox or "goodies"/contrib area of
> the Struts codebase though.

Erik,
I really like the idea of the tag and I've added my suggestions for
improvement to the bug report.

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

>
> > Also, just a query, Does your tag extend MessageTag ?
> > Is it a good idea to do that ?
> >
>
> No, it doesn't.  See here:
>
>       http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/struts/
> struts-resume/src/web/org/appfuse/webapp/taglib/
> LabelTag.java?rev=HEAD&content-type=text/plain
>
> I personally do not find it worthwhile to extends Struts tags.  They
> are not designed as I would have designed them (subclassses not
> exposing some parent class attributes in the TLD is *bad* IMHO) and the
> attributes on the MessageTag are not needed for my label tag.  All I
> need is key, nothing else.

I made some effort recently to refactor the tags into more appropriate
chunks.  While they're still not great for subclassing, they have
improved.

David

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


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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