PDA

View Full Version : Referencing non mscorlib types in Validators


ianren
08-30-2007, 07:12 AM
Not sure if this is the right place for the post. But its WinForms related for me :).

I am using the Validation framework with a WinForms GUI. There is a DateTimePicker control on the form and I want to validate that the date time on my domain object is greater than the min date of the DateTimePicker control. The conditional validator I have below doesn't seem to work.


<v:condition test="ExpiryDate > System.Windows.Forms.DateTimePicker.MinValue">
<v:message id="errorExpiryDateRequired" providers="expiryDate, validationSummary"/>
</v:condition>


Its not picking up System.Windows.Forms.DateTimePicker as a fully qualified name, instead its thinking that is part of the validation context.

Have also tried using T(System.Windows.Forms.DateTimePicker.MinValue, System.Windows.Forms).MinValue but it has the same problem.

As a work around I am writing a custom validator to check for this, but it seems a bit overkill.

What is the correct way to specify a non mscorlib.dll class in a conditional validator test?

Bruno Baia
08-30-2007, 01:54 PM
Hi,

have you tried this :

T(System.Windows.Forms.DateTimePicker, System.Windows.Forms).MinValue


Bruno

ianren
09-03-2007, 03:27 AM
Yup, I tried that and it would've worked if i wasn't on spring.net 1.0.2 ;)

Found that the correct syntax for types 1.0.2 was
type(classname, assemblyname), used that and everything was fine.

Thanks for your help.