cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Lutz <mat...@gmx.at>
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 
disabled.

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 Repeater.java and 
disable the controls in Repeater.java
-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 :-).

Regards,
Tom


[1] http://www.mail-archive.com/users@cocoon.apache.org/msg29453.html
[2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36781
[3] http://cocoon.apache.org/2.1/userdocs/forms/validation.html

Mime
View raw message