Vadim Gritsenko dijo:
Antonio Gallardo wrote:
Sylvain Wallez dijo:Actually, this is even better idea. Can we have form level validators?
Tim Larson wrote:
On a related topic, other than because of history, why is "required" an attribute of the widget rather than an attribute of the validation element? Conceptually, "required" is part of a form's validation logic.
I would add:True. But being required produces a distinguishing display that is not possible if only represented by a validator.
We can note 2 levels of validations: form level and widget level.
Yes, already have one. See:
http://archives.real-time.com/pipermail/cocoon-devel/2004-January/025750.html
No, I mean in form model itself. To give you context:
<wd:form xmlns:wd="http://apache.org/cocoon/woody/definition/1.0"> <wd:validation> <wd:assert test="Or(IsNull(a), IsNull(b))"/> </wd:validation> <wd:widgets> <wd:field id="a"> <wd:datatype base="string"/> </wd:field> <wd:field id="b"> <wd:datatype base="string"/> </wd:field> </wd:widgets> </wd:form>
PS Antonio, can you attach not a Javascript, but custom Java validator
to the form?
I think this is posible, by calling a java function inside of a javascript
function.
No, I mean without Flowscript, and I mean not a Javascript form object but real Form class.
org.apache.cocoon.woody.formmodel.Form does not seem to have any setters/getters for validators, so I presume that's not possible.
Vadim
