myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: Comparable validation design
Date Tue, 25 Oct 2005 21:01:39 GMT
I've put an initial version of this validator at the following URL
(manually constructed since the link isn't active yet -- may have
typos).

http://cvs.sourceforge.net/viewcvs.py/jsf-comp/componentsandbox/src/java/org/apache/myfaces/custom/comparetovalidator/CompareToValidator.java

It'll probably take a little time for the link to become active, so
you might have better luck grabbing it from jsf-comp cvs directly. 
Make sure to get at least Revision: 1.2 as I added the documentation
in that revision.

I can also email it to anyone who wants it.



On 10/25/05, Jesse Alexander (KBSA 21)
<alexander.jesse@credit-suisse.com> wrote:
> -----Original Message-----
> 1) What should happen if the compared values do not implement
> Comparable and no Comparable is provided?
>
> Right now, it's passively passing validation.   I wonder if it should
> throw a FacesException (not ValidationException) instead?
> -----Original Message-----
> FacesException.
> We could try to catch it already in the tag, but for safety, throw
> the exception during validation.
>
> -----Original Message-----
> 2) If either the foreign component value or the parent component value
> are null, perform no validation?  This is going to happen by default
> if the parent component value is null since JSF won't execute
> validators in that case.
>
> We can't validate if:
> a) value is null and foreign value is null
> b) value is null and foreign value is not null.
>
> We could try to validate if
> c) value is not null and foreign value is null
> d) value is not null and foreign value is not null
>
> For consistency, I'd say we'd do the same thing for the foreign key,
> and only try to validate for case d).
> -----Original Message-----
> +1: only d) should be validated
>
> regards
> Alexander
>

Mime
View raw message