cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [cforms] Moving <validation> out of <datatype>
Date Wed, 14 Apr 2004 22:13:41 GMT
Bruno Dumon wrote:

>On Wed, 2004-04-14 at 11:40, Sylvain Wallez wrote:
>>Hi all,
>>A few weeks ago, I generalized validation to every widgets, and not only 
>>fields. The main visible result of this is that <fd:validation> is now a 
>>direct child of <fd:field> (or other widget-defining element), and no 
>>more a child of <fd:datatype>.
>>Validation as a child of <fd:datatype> is still supported as a legacy 
>>behaviour, but I would like to remove it to drive people towards the new 
>>generalized validation. My plan to ease the migration is to raise a 
>>meaningful exception ("fd:validation has moved") whenever we encounter a 
>>fd:validation inside a fd:datatype.
>Just been looking a bit at this...
>For the validation rules associated with datatypes, it is checked that
>the validation rule is compatible with the datatype (i.e. can handle the
>kind of objects that the datatype represents). Does such a check still
>happen? Or will this give errors at runtime?

Damn, missed that one...

The problem with the generalized validation is that it is erm... 
generalized. And as such validation rules can be applied to any kind of 
widget, including those that don't have a value.

A solution is to generalize this check also, by introducing a 
ValidationRule.canValidate(WidgetDefinition) which, in the case of typed 
validators, will get the widget definition's datatype to perform today's 


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message