Consider an example where the password is not properly repeated - that
is, the value of Password is valid, but the value of PasswordRepeated
does not properly resemble Password and is therefore invalid.

This makes PasswordRepeated the invalid value, even though the not-
equal relationship is symmetric.

I made a bean validator as well, but then I have a problem: I cannot
report back which property caused the error.

Just for fun, I implemented a new interface in NHibernate Validator:
IValidatorWithPropertyName, inheriting from IValidator and adding a
PropertyName string property - and then in ClassValidator I pass on
the property name if it is there, instead of just null, which was
always used for InvalidValue.PropertyName for bean validators. It
seems to work like I want it to.





On 19 Apr., 20:38, Dario Quintana <[email protected]>
wrote:
> You need a Bean-Validator, sorry, no example but tests. I'll prepare an
> example later.
>
> But I don't get, you want a property caused the error, both properties are
> wrong, both are differents.
>
> On Sun, Apr 19, 2009 at 3:12 PM, Mogens Heller Grabe
> <[email protected]>wrote:
>
> > ...
>
> - implementing the necessary logic in `PasswordMustBeRepeated` which
>
> > would be called by my custom class-level validation attribute. That
> > worked, but then there doesn't seem to be a way to give back
> > information on _which_ property caused an error in the event that the
> > validation fails.
> > ...
>
> --
> Dario Quintanahttp://darioquintana.com.ar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"NHibernate Contrib - Development Group" 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.ar/group/nhcdevs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to