cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: woody2.js: custom validation issue in cocoon-2.1.2 to 2.1.4
Date Thu, 18 Mar 2004 14:27:50 GMT
Joerg Heinicke wrote:

>Alex Kovacs <alexk <at> fast.fujitsu.com.au> writes:
>  
>
>>            if (this.validator == null) {
>>		  //if no custom validation
>>              this.isValid = this.form.isValid();
>>            } else {
>>	          var validated = true;
>>	          
>>	          if(!this.validator(this.form, bizData))
>>	          	validated = false;
>>	          
>>	          if(!this.form.isValid())
>>	          	validated = false;
>>	          	
>>              this.isValid = validated;
>>              finished = this.isValid;
>>            }
>>    
>>
>
>I have committed it this way to the forms block in CVS:
>
>if (finished) {
>    if (this.validator == null) {
>        this.isValid = this.form.isValid();
>    } else {
>        this.isValid = this.form.isValid() & this.validator(this.form, bizData);
>    }
>    finished = this.isValid;
>}
>
>Should work as well. Can you test it?
>  
>

This was written that way on purpose, in order for the flow-level 
validation do be assured that the form was valid and not to care about 
it. This change means that flow-level validation has now to check if the 
form is valid, which may break some of the existing uses.

Note that I plan to remove this feature in CForms as we can now add 
arbitrary validators on the Form itself.

Sylvain

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


Mime
View raw message