Hi All,

I'm a little confused by the behaviour in AbstractValidatorAction for
parameters that have the nullable property set to "yes".

If the parameter is nullable and I don't set the value in the form (so it
becomes null) then the method validate<Type>(...) will set the value to its
default value and then apply any other constraint tests set on the property.
If one of these constraint tests fails then the form validation fails which
is not what I expected since I declared that the parameter could be null in
the first place!

Also, is it correct that if the default is not set for a nullable parameter,
this will cause an NPE when any other constraint is tested (on the default,
since this is substituted for a nullable parameter).

I can patch this is people agree this is a bug, but maybe the design was
that you could not have a parameter that has both constraints *and* the
ability to be null:

<!-- if they enter their age it must be between 18 and 120 -->
<parameter type="long" name="age" min="18" max="120" nullable="yes"/>

Thanks,

Best Regards,

Chris

--
Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Email: [EMAIL PROTECTED]
Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at http://fipa-os.sourceforge.net/

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly
prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to