[Stripes-users] Multiple Field Errors, One Error Message

2009-02-27 Thread Smith, Edward
Hello,

 

   I have a situation with a form containing indexed fields (i.e.
item[0].number, item[1].number, etc) and for one specific custom
validation I want to highlight all the indexed error fields in red yet
only show the corresponding error message once in the stripes:errors
tag.  Right now the action bean code does a basic ValidationErrors
population which highlights all indexed fields in red as expected but
also replicates the error message in stripes:errors:

 

errors.add(indexedFieldName, new SimpleError(This
message is replicated for each indexed field in error));

 

   Anyone have an idea on the best way to highlight all the indexed
error fields yet only show a single error message in stripes:errors?

 

Ed

 



The information contained in this message and any attachments is intended only 
for the use of the individual or entity to which it is addressed, and may 
contain information that is PRIVILEGED, CONFIDENTIAL, and exempt from 
disclosure under applicable law.  If you are not the intended recipient, you 
are prohibited from copying, distributing, or using the information.  Please 
contact the sender immediately by return e-mail and delete the original message 
from your system.--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Multiple Field Errors, One Error Message

2009-02-27 Thread Iwao AVE!
Hi Ed,

Assuming you're using Stripes 1.5, adding an empty error to a field
highlights the field but does not output any error message in the
stripes:errors / tag.

errors.add(indexedFieldName, new SimpleError());

Then you can add another error with a dummy field name.

errors.add(dummy, new SimpleError(This message is output only
once.));

HTH,
Iwao

on 09.2.27 11:25 PM Smith, Edward said the following:
 Hello,
 
I have a situation with a form containing indexed fields (i.e. 
 item[0].number, item[1].number, etc) and for one specific custom 
 validation I want to highlight all the indexed error fields in red yet 
 only show the corresponding error message once in the stripes:errors 
 tag.  Right now the action bean code does a basic ValidationErrors 
 population which highlights all indexed fields in red as expected but 
 also replicates the error message in stripes:errors:
 
 errors.add(indexedFieldName, new SimpleError(
This message is replicated for each indexed field in error));
 
Anyone have an idea on the best way to highlight all the indexed 
 error fields yet only show a single error message in stripes:errors?
 
 Ed


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Multiple Field Errors, One Error Message

2009-02-27 Thread Oscar Westra van Holthe - Kind
On 28-02-2009 at 01:16, Iwao AVE! wrote:
 Assuming you're using Stripes 1.5, adding an empty error to a field
 highlights the field but does not output any error message in the
 stripes:errors / tag.
 
 errors.add(indexedFieldName, new SimpleError());
 
 Then you can add another error with a dummy field name.
 
 errors.add(dummy, new SimpleError(This message is output only
 once.));

In addition to this, IIRC it was mentioned on the list at one time that
multiple identical error messages appear only once. You may be able to use
that too, although personally I like the empty error message better.


Oscar

-- 
   ,-_
  /() ) Oscar Westra van holthe - Kind  http://www.xs4all.nl/~kindop/
 (__ (
=/  ()  Freedom is a willingness to accept consequences.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Multiple Field Errors, One Error Message

2009-02-27 Thread Iwao AVE!
It seems to be more efficient.
Thank you for pointing it out.

Regards,
Iwao

on 09.2.28 1:38 AM Oscar Westra van Holthe - Kind said the following:
 On 28-02-2009 at 01:16, Iwao AVE! wrote:
 Assuming you're using Stripes 1.5, adding an empty error to a field
 highlights the field but does not output any error message in the
 stripes:errors / tag.

 errors.add(indexedFieldName, new SimpleError());

 Then you can add another error with a dummy field name.

 errors.add(dummy, new SimpleError(This message is output only
 once.));
 
 In addition to this, IIRC it was mentioned on the list at one time that
 multiple identical error messages appear only once. You may be able to use
 that too, although personally I like the empty error message better.
 
 
 Oscar


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Multiple Field Errors, One Error Message

2009-02-27 Thread Smith, Edward
That did the trick.  Thank you very much Iwao!

Ed

-Original Message-
From: Iwao AVE! [mailto:haraw...@gmail.com] 
Sent: Friday, February 27, 2009 10:17 AM
To: Stripes Users List
Subject: Re: [Stripes-users] Multiple Field Errors, One Error Message

Hi Ed,

Assuming you're using Stripes 1.5, adding an empty error to a field
highlights the field but does not output any error message in the
stripes:errors / tag.

errors.add(indexedFieldName, new SimpleError());

Then you can add another error with a dummy field name.

errors.add(dummy, new SimpleError(This message is output only
once.));

HTH,
Iwao

on 09.2.27 11:25 PM Smith, Edward said the following:
 Hello,
 
I have a situation with a form containing indexed fields (i.e. 
 item[0].number, item[1].number, etc) and for one specific custom 
 validation I want to highlight all the indexed error fields in red yet

 only show the corresponding error message once in the stripes:errors

 tag.  Right now the action bean code does a basic ValidationErrors 
 population which highlights all indexed fields in red as expected but 
 also replicates the error message in stripes:errors:
 
 errors.add(indexedFieldName, new SimpleError(
This message is replicated for each indexed field in error));
 
Anyone have an idea on the best way to highlight all the indexed 
 error fields yet only show a single error message in stripes:errors?
 
 Ed



--
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source code:
SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users



The information contained in this message and any attachments is intended only 
for the use of the individual or entity to which it is addressed, and may 
contain information that is PRIVILEGED, CONFIDENTIAL, and exempt from 
disclosure under applicable law.  If you are not the intended recipient, you 
are prohibited from copying, distributing, or using the information.  Please 
contact the sender immediately by return e-mail and delete the original message 
from your system.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users