You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by DeRose Jonathan <de...@bah.com> on 2003/06/06 22:05:08 UTC

Introduction and a proprosal to add new functionality to Struts: Automatic highlighting of errored form elements

Hello,

    I have an idea that I would like to propose to the Struts community
involving the HTML tag library; automatic highlighting of errored form
elements.  I have used Struts for a couple medium sized projects and always
extended the tags to get this functionality.  After doing this two or three
times, I thought it would be great if Struts has this functionality built
in.

     I have gone through all the source and feel confident about the changes
that would need to be made.  I have prepared documentation describing all of
the details, but I wanted to post this first to introduce myself and my
idea.  If you guys would like to hear more, I would love to post my
documentation for everyone to look at.

Thanks,
Jonathan R. DeRose



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


RE: Introduction and a proprosal to add new functionality to Struts: Automatic highlighting of errored form elements

Posted by DeRose Jonathan <de...@bah.com>.
I am very open to suggestions, but I do feel this change is a better fit
incorporated into the tag library as opposed to standing on top of it.
Inclusion requires signifcantly less code since contol of styles is
localized to the BaseHandlerTag.  Extending the tags is a lot more code (the
same code has to be repeated in each input-type tag) and more complex
(styles must be set over and over as attributes are set, rather than making
one adjustment after everything has been set.  This is further complicated
due to not having control on the order that attributes get set.)

A quick note, when I wrote 'automatic highlighting of errored form
elements': it is only automatic if a style has been defined to use.
Example:
< html:text property="name" styleClass="valid" errorStyleClass="invalid" ...
where 'valid' is the css style class to use normally and 'invalid' would be
used if there was an error.
if no errorStyleClass was defined, there would be no highlighting.

-Jonathan


-----Original Message-----
From: James Mitchell [mailto:jmitchell@apache.org]
Sent: Friday, June 06, 2003 4:14 PM
To: Struts Developers List
Subject: Re: Introduction and a proprosal to add new functionality to
Struts: Automatic highlighting of errored form elements


Sounds like a nice 3rd party library.  Are you open to suggestions?  I have
a few ideas about this myself.


--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
770-822-3359
AIM:jmitchtx


----- Original Message -----
From: "DeRose Jonathan" <de...@bah.com>
To: "Struts Developers List" <st...@jakarta.apache.org>
Sent: Friday, June 06, 2003 4:05 PM
Subject: Introduction and a proprosal to add new functionality to Struts:
Automatic highlighting of errored form elements


> Hello,
>
>     I have an idea that I would like to propose to the Struts community
> involving the HTML tag library; automatic highlighting of errored form
> elements.  I have used Struts for a couple medium sized projects and
always
> extended the tags to get this functionality.  After doing this two or
three
> times, I thought it would be great if Struts has this functionality built
> in.
>
>      I have gone through all the source and feel confident about the
changes
> that would need to be made.  I have prepared documentation describing all
of
> the details, but I wanted to post this first to introduce myself and my
> idea.  If you guys would like to hear more, I would love to post my
> documentation for everyone to look at.
>
> Thanks,
> Jonathan R. DeRose
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Introduction and a proprosal to add new functionality to Struts: Automatic highlighting of errored form elements

Posted by James Mitchell <jm...@apache.org>.
Sounds like a nice 3rd party library.  Are you open to suggestions?  I have
a few ideas about this myself.


--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
770-822-3359
AIM:jmitchtx


----- Original Message ----- 
From: "DeRose Jonathan" <de...@bah.com>
To: "Struts Developers List" <st...@jakarta.apache.org>
Sent: Friday, June 06, 2003 4:05 PM
Subject: Introduction and a proprosal to add new functionality to Struts:
Automatic highlighting of errored form elements


> Hello,
>
>     I have an idea that I would like to propose to the Struts community
> involving the HTML tag library; automatic highlighting of errored form
> elements.  I have used Struts for a couple medium sized projects and
always
> extended the tags to get this functionality.  After doing this two or
three
> times, I thought it would be great if Struts has this functionality built
> in.
>
>      I have gone through all the source and feel confident about the
changes
> that would need to be made.  I have prepared documentation describing all
of
> the details, but I wanted to post this first to introduce myself and my
> idea.  If you guys would like to hear more, I would love to post my
> documentation for everyone to look at.
>
> Thanks,
> Jonathan R. DeRose
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Introduction and a proprosal to add new functionality to Struts: Automatic highlighting of errored form elements

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
This idea is very similar to this one:

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

I have a <custom:label> tag that I implemented to do this very thing 
for field labels.  I use the standard <html:*> form tags though, and do 
not style the fields themselves differently if they are in error, 
although that sounds like a good addition.

I get a couple of interesting benefits from my custom label tag:

- field labels are looked up in the resources with keys of the form 
FormName.fieldName (so naming conventions are needed)

- Asterisk appears by field labels that are required (available from 
the Validator metadata)

- In a special mode, the labels turn into hyperlinks that the user (an 
admin) can click to pop-up another window, type in a new label, and 
save it (we store resource text in a database with a custom DbResources 
implementation).

More integrated error handling in Struts gets a +1 from me!  :)

	Erik


On Friday, June 6, 2003, at 04:05  PM, DeRose Jonathan wrote:

> Hello,
>
>     I have an idea that I would like to propose to the Struts community
> involving the HTML tag library; automatic highlighting of errored form
> elements.  I have used Struts for a couple medium sized projects and 
> always
> extended the tags to get this functionality.  After doing this two or 
> three
> times, I thought it would be great if Struts has this functionality 
> built
> in.
>
>      I have gone through all the source and feel confident about the 
> changes
> that would need to be made.  I have prepared documentation describing 
> all of
> the details, but I wanted to post this first to introduce myself and my
> idea.  If you guys would like to hear more, I would love to post my
> documentation for everyone to look at.
>
> Thanks,
> Jonathan R. DeRose
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org