« November 2009 | Main | February 2010 »

January 2010 Archives

January 25, 2010

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

About January 2010

This page contains all entries posted to Comtaste Consulting | Enterprise RIA consulting and development in January 2010. They are listed from oldest to newest.

November 2009 is the previous archive.

February 2010 is the next archive.

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

Powered by
Movable Type 3.33