cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Bug in Forms v1, 2 & 3 using Cocoon v2.1.5, flow, javascript validation and debugging
Date Wed, 09 Jun 2004 00:16:44 GMT
On 08.06.2004 23:20, Yatin Shah wrote:

> My requirement:
> Perform business level validation to ensure the entered data are valid 
> before notifying the user that
> their form request is accepted and refreshing the web page with 
> acceptance message.
> [business level: requires access to external database for checking valid 
> values.]
> 
> Pre 2.1.5 solution:
> Define a javascript function, a part of the flow script, to do business 
> validation processing and associate this function with the form using:

> A. "I used fd:javascript though where only external validation functions 
> are called. So I determine how a field has to be validated in the form 
> definition, but the validation itself is scripted in external js 
> files."  
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=108639582110249&w=2
> Joerg, can you give more details! Is it possible to access flow 
> variables from your external js file?

I have a file validate.js that has some validateXYZ() functions in it. 
validate.js is added to the sitemap like any other flowscript js file. 
In the form definition I have:

<fd:field>
   <fd:validation>
     <fd:javascript>
       return validateXYZ(widget);
     </fd:javascript>
   </fd:validation>
</fd:field>

> B. "On each widget, you can add validators using the 
> Widget.addValidator(...) method. The argument is an implementation of 
> WidgetValidator. See the javadoc of that interface for more details on 
> what an implementation of a WidgetValidator is supposed to do." 
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108401608717385&w=2
> This seems to be for individual widget level validation support. How can 
> this be used for the form level validation? A sample code will be very 
> helpful.

Bruno explained some more details here: 
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=108555680116244&w=4.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message