cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Lutz <>
Subject [CForms] Cardinality check for repeater
Date Wed, 28 Sep 2005 09:52:45 GMT
Hi list !

A recent discussion on the users list [1] showed that there is interest 
in implementing a minimum/maximum number of rows check in CForm's repeaters.

Jorg Heymans submitted a patch to bugzilla [2], that adds the 
minimum-size and maximum-size attributes to the repeaters definition, 
and contains a sample on disabling the controls with jx macros...

To complete this feature validation should be added. So, if the current 
size is lower or greater than the specified values, a validation message 
should be displayed, and the add-row or remove-row buttons should be 

Now the question for the CForm gurus :-):

What's the best way to do it ?

We've found two scenarios so far:
-try to add the validation in the validate function of and 
disable the controls in
-write a validator class (like the ones described in [3]), set a flag, 
and leave enabling/disabling of the controls to the presentation layer 
(the forms-field-styling.xsl, or jx macros..?)

I'll try to implement it, but some advice where to start, and what to 
touch would really be great, as am I still a CForms greenhorn :-).



View raw message