« The new Spring 3.0 and the integration with Flex 3 and BlazeDS | Main | Axis2, Spring and Annotations »

Fields Validation with LiveCycle Designer 8 for XDP or Dynamic PDF files

One of the most important problem in the creation of Dynamical Pdf is the validation of data inserted by user. We know that LiveCycle Designer support us in validating with the following events:

  • prePrint: dispatched when the user starts to Print the document
  • preSave: dispatched when the user starts to Save the Document
  • preSubmit: dispatched when the user starts to Submit the Document
  • preExecute: dispatched when the user starts a data connection inside the Document

and we have also the possibility to change the status of a field to 'Required' (the default status of a designer object is 'Optional').
But if we put a control inside one of the events above, we can't stop the user action (view the Adobe Documentation for more!) if validation fails. For this reason we have the possibility to add to our XFA Application (version 2.5) an object called Validation Object.
Unfortunately we can't add it into the Design Model but we have to insert this object into the XML Source of our Application, so we have to find the following tags:

<config xmlns="http://www.xfa.org/schema/xci/1.0/">
<agent name="designer">
...
</agent>

<present>

<!-- [0..n] -->
...

and put the <validate> element into the <present> element:

<config xmlns="http://www.xfa.org/schema/xci/1.0/">
<agent name="designer">
...
</agent>
<present>
<!-- [0..n] -->
<validate>prePrint preSubmit </validate>
...

When you are done making the change, click on the Design View tab and make sure you say “yes” to have your changes applied.

With the release of XFA 2.8 and Acrobat/Reader 9.0, the <validate> element is now located under the <acrobat> element in the Source XML:

<config>
...
<acrobat>
...
<validate>prePrint </validate>
...
</acrobat>
...
</config>

With this Validation Object we can stop only Print, Submit and Execute actions. The Save action can not be stopped by the Validation Object (I think because an user would like to save a Pdf without filling all the fields and complete them in a second time).

Here are two examples: the first does not have the validation object in XML Source (here) while the second has this object built for the prePrint and preSubmit events (here).

Enjoy

TrackBack

TrackBack URL for this entry:
http://blog.comtaste.com/mt-tb.cgi/100

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on January 25, 2010 4:26 PM.

The previous post in this blog was The new Spring 3.0 and the integration with Flex 3 and BlazeDS.

The next post in this blog is Axis2, Spring and Annotations.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33