Hi David,
if I understand it correctly, this is the problem:
new DUPLICATE_LOGIN("User name already in use")
You give it the message instead of the subject, so the
DUPLICATE_LOGIN:login block simply doesn't match.
Does that help?
Geert
On 05 Sep 2007, at 12:58, David Herbert wrote:
>
> In a user manager application, I have been trying to get a couple of
> custom errors to work without success. These are:
>
> DUPLICATE_LOGIN when a login name already exists
> PASSWORD_MISMATCH when password and its retyped version don't match up
>
> In my template I have the following blocks:
>
> <r:b name="ERRORS:login"><r:v name="ERRORS"/></r:b>
> <r:b name="ERRORMESSAGE:login"><r:v name="ERRORMESSAGE"/></r:b>
> <r:b name="MANDATORY:login">Login name is required</r:b>
> <r:b name="WRONGLENGTH:login">Login can be between 4 and 50 characters
> long</r:b>
> <r:b name="DUPLICATE_LOGIN:login">Login name already in use</r:b>
> <r:b name="ERROR:login">Invalid login name</r:b>
>
> I have implemented two small classes e.g:
>
> public class DUPLICATE_LOGIN extends ValidationError {
>
> public static final String IDENTIFIER_DUPLICATE_LOGIN =
> "DUPLICATE_LOGIN";
>
> public DUPLICATE_LOGIN(String subject) {
> super(IDENTIFIER_DUPLICATE_LOGIN, subject);
> }
>
> }
>
> And in my element when the error is encountered I do:
>
> uData.addValidationError(new DUPLICATE_LOGIN("User name already in
> use"));
>
> where uData is the submission bean containing "login" form parameter.
>
> I can verify that the validation error is added with "identifier" and
> "subject" set as required. ErroneousValue is null, and overrideable
> false. I haven't set either of these.
>
> However, no error message appears to report the error. Other error
> messages concerning "login" form parameter do appear. What am I doing
> wrong? I couldn't follow the documentation in cookbook under
> Validation, or at least, I couldn't get it to work. So I browsed RIFE
> code on Fisheye to get something to at least compile.
>
> Grateful for any help.
>
> David Herbert
> British Antarctic Survey.
>
> --
> This message (and any attachments) is for the recipient only. NERC
> is subject
> to the Freedom of Information Act 2000 and the contents of this
> email and any
> reply you make may be disclosed by NERC unless it is exempt from
> release under
> the Act. Any material supplied to NERC may be stored in an electronic
> records management system.
>
>
> >
--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---