How were you able to access the "Collection" object containing the error
messages
from your extension?
Anand Narayan
(302) 255-8027
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 4:57 PM
To: [EMAIL PROTECTED]
Subject: Re: Error messages
Had to do similar stuff in the prototype I'm working on. We have error
icons that the users want displayed beside input fields that had validation
failures. So, the direction I leaned towards was a conditional tag if a
specific error is present. I could not find a tag provided with Struts
that let me do that, so I wrote one. There may have been a way to do it
with existing Struts logic tags.
example:
<extensions:errorPresent property="zipCode">
<td><img src="img/error.gif" alt="Error! Please fix zip
code"></td>
</extensions:errorPresent>
The tag code is similar to Struts ErrorTag. It would have been best to
inherit my tag class straight from Strut's error tag, but it didn't look
like it was factored in such a way as to make that possible (I believe the
code that looked for errors and assembled them into a collection was mixed
in the same method with the code that outputs the error text).
This is not a good final solution obviously, but it seems like some kind of
conditional error-presence-based-on-property tag is a good general approach
for this kind of problem.
Jim Weaver
Software Developer - ThoughtWorks
"Narayan,
Anand" To:
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
<ANarayan@Jun cc:
iper.com> Subject: Error messages
08/17/2001
03:25 PM
Please
respond to
struts-user
Using ActionError and the html:ErrorTag I am able to display errors on the
page & also format the error messages using errorheader and
errorfooter.
Is there any way ( Tag or otherwise ) to highlight the field ( field label
&
the field itself) that the error refers to? e.g Displaying the label
and the textbox/checkbox in red.
Thanks
Anand Narayan
(302) 255-8027
_______________________________________________________
Juniper Bank
"Rated #1 in Customer Confidence"
Gomez Inc., Summer 2001 Internet Credit Card Scorecard
www.juniper.com
_______________________________________________________
This e-mail and any files transmitted with it may contain confidential
and/or proprietary information. It is intended solely for the use of the
individual or entity who is the intended recipient. Unauthorized use of
this
information is prohibited. If you have received this in error, please
contact the sender by replying to this message and delete this material
from
any system it may be on.
_______________________________________________________
Juniper Bank
"Rated #1 in Customer Confidence"
Gomez Inc., Summer 2001 Internet Credit Card Scorecard
www.juniper.com
_______________________________________________________
This e-mail and any files transmitted with it may contain confidential
and/or proprietary information. It is intended solely for the use of the
individual or entity who is the intended recipient. Unauthorized use of this
information is prohibited. If you have received this in error, please
contact the sender by replying to this message and delete this material from
any system it may be on.