cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: [cforms] new validation: every widget can have a validator
Date Wed, 04 Feb 2004 22:12:04 GMT
Joerg Heinicke wrote:

> From the form1 sample (shortened):
>
> <wd:repeater id="contacts">
>   <wd:validation>
>     <wd:javascript>
>           ...
>         for (var i = 0; i &lt; widget.size; i++) {
>
> Which properties are available here? Obviously widget, but maybe also 
> form? This would be cool as I can replace the XReporter asserts that I 
> have problems with.


The form is available on each and every widget through 
"widget.getForm()" or "widget.form" in JS.

I also added get/setAttribute on Form that allows passing arbitrary data 
between the enclosing context (flowscript or action) and the various 
components operating on the form (validators, event handlers, etc).

>           ...
>             row.getWidget("firstname").setValidationError(new 
> Packages.org.apache.cocoon.woody.datatype.ValidationError("Duplicate 
> contact name", false));
>
> Must we specify 
> Packages.org.apache.cocoon.woody.datatype.ValidationError() ?? It 
> seems to be to much typing. What about just setValidationError(String 
> [, more parameters])? Do we loose flexibility? At the moment there is 
> only o.a.c.w.validation.ValidationError and the deprecated extending 
> o.a.c.w.datatype.ValidationError.


My plan is to make some of the most useful Woody classes directly 
visible in the JS snippets. This includes ValidationError, among others.

> BTW, shouldn't the sample create a non-deprecated ValidationError?


Yeah sure. This is the first commit of this new feature, which needs 
some polishing. The deprecated ValidationError remains from the various 
code iterations.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Mime
View raw message