A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/484.html
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
Parts
=====
Content
-------
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>fd:java</p>
</td>
<td>
--- <p>al datatypes</p>
+++ <p>all datatypes</p>
</td>
</tr>
</tbody>
(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>
<h2>fd:java</h2>
(5 equal lines skipped)
<pre><fd:java class="com.mycompany.validators.MyCustomValidator"/>
</pre>
--- <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>
+++
</body>
</html>
Fields
======
no changes
Links
=====
no changes
Custom Fields
=============
no changes
Collections
===========
no changes