cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [DAISY] Updated: Cocoon Forms: Validation
Date Thu, 23 Mar 2006 16:33:26 GMT
A document has been updated:

Document ID: 484
Branch: main
Language: default
Name: Cocoon Forms: Validation (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 3/23/06 4:33:09 PM
Updated by: Bruno Dumon

A new version has been created, state: publish

This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 9399 bytes (previous version: 8614 bytes)
Content diff:
(234 equal lines skipped)
--- <p>al datatypes</p>
+++ <p>all datatypes</p>
(86 equal lines skipped)
    definition. The widget in question is available in the Javascript snippet as a
    variable called <tt>widget</tt>.</p>
--- <p>Checkout the samples of Cocoon for an example.</p>
+++ <p>See the samples of Cocoon for an example.</p>
(5 equal lines skipped)
    <pre>&lt;fd:java class="com.mycompany.validators.MyCustomValidator"/&gt;
--- <p>Checkout the samples of Cocoon and look the
--- org.apache.cocoon.forms.samples.CustomBirthDateValidator for a sample. Please
--- note that your custom validator MUST add a validation error to the widget;
--- simply returning false will not display an error to the user.</p>
+++ <p>For an example, see the class
+++ org.apache.cocoon.forms.samples.CustomBirthDateValidator included with Cocoon.
+++ Please note that, as defined by the WidgetValidator contract, the custom
+++ validator must add a validation error to the widget; simply returning false will
+++ not display an error to the user.</p>
+++ <p>The validator instance is part of the form definition and hence shared
+++ between multiple form instances. This means it should usually not keep any state
+++ in its instance variables.</p>
+++ <p>The validator class can optionally implement Avalon interfaces such as
+++ LogEnabled, Serviceable and Contextualizable to get access to the logger,
+++ service manager and context respectively. Via the context, you can get access to
+++ the request object (using the ContextHelper utility class of Ccooon).</p>
+++ <p>As an alternative for fd:java, you can also add validators at run time to a
+++ form instance, using the addValidator method on a form or widget. Since you then
+++ instantiate the validator yourself, you can pass it anything you want, and it
+++ can be stateful.</p>

no changes

no changes

Custom Fields
no changes

no changes

View raw message