Stefan Cameron on Forms
Building intelligent forms using Adobe LiveCycle Designer

'XFA' Category Archive

Careful with Form Compatibility Settings

Let me put it simply: I got burned by using a particular syntax to check the existence of a field inside a subform object due to form compatibility settings in LiveCycle Designer 8.2.

What?

It started with a form I had created using Designer 8.1 which was set to target Acrobat 8.1/XFA 2.6. Later-on, I installed Designer 8.2 and wanted to update my form to target Acrobat 9/XFA 2.8.

In my form, I had a script object with various functions that used the following syntax to test the existence of a field inside a subform object which was passed-in to these functions as a parameter:

if (subformObj.someField)

The result of this was what I expected: If ‘someField’ existed inside ‘subformObj’, the IF statement would evaluate to ‘true’; if it didn’t, it would evaluate to ‘false’. According to the rules of dynamic properties in JavaScript, this was all fine and dandy.

Continue reading…


Posted by Stefan Cameron on February 11th, 2009
Filed under Acrobat,Debugging,Designer,Scripting,XFA

New book: Acrobat and Designer Bible

PDF Forms Using Acrobat and LiveCycle Designer Bible

Angie Okamoto, Director of Enterprise Development at Easel Solutions, and Ted Padova, the "PDF Guru" and author of the "Adobe Acrobat PDF Bible" series, have published a new book titled, "PDF Forms Using Acrobat and LiveCycle Designer Bible". I’m sure it’ll be a great reference!

Their book is available now on Amazon.com and Wiley.com.


Posted by Stefan Cameron on February 5th, 2009
Filed under Acrobat,Books,Data Binding,Designer,Instance Manager,Scripting,Tables,Tutorials,XFA

Submit or Execute on Other Events

I discovered something interesting the other day: Just because Designer wants you to type script for a field’s Full event doesn’t mean you have to execute script when the Full event is triggered.

The XFA 2.8 specification specifies the <event> node’s content as being one of the following nodes: <script>, <execute> (executes a web service data connection), <submit> (causes the form to be submitted via email or HTTP) or <signData> (causes the form to be signed). Only one may be specified and whatever content is there will be executed when the event is triggered.

This means that you could, for example, cause a web service to be executed whenever a repeatable subform’s index changes (i.e. whenever you add/remove instances).

Is this useful? Well, perhaps not, but I thought it was interesting! Who knows what you might think of doing with this…

The only catch to all this is that Designer only lets you enter script (JavaScript or FormCalc) into an event, thereby specifying an event’s content as <script> as opposed to <submit> or <execute>. If you want to, say, cause a form submit when a field’s Full event is triggered, you’ll have to go to the XML Source and set the event’s content to a <submit> node yourself. An easy way to do this is first to add an Email/HTTP Submit Button to the form, set the field’s Full event to a placeholder script, go to the XML Source view, find the button using the Hierarchy palette, copy its Click event <submit> node and paste it into the field’s Full event so it looks like what’s below and delete the button:

<event activity="full" name="event__full">
    <submit format="xml" textEncoding="UTF-8" target="mailto:"/>
</event>

Sample Form

Check-out my little sample form that causes the form to be submitted via email when you fill the text field at the top and where a web service data connection is executed whenever you add an instance of Subform2 using the button at the bottom (below the web service import/export fields).

Download Sample [pdf]

Sample Minimum Requirements: Designer and Acrobat Standard/Pro 8.0 (XFA 2.5)


Posted by Stefan Cameron on January 30th, 2009
Filed under Events,Scripting,Tutorials,XFA

MAX 2008 Tutorial – Part 2 – Flex Code

Welcome to the second in a three-part post series on importing data into a form guide (and, by extension, a PDF form). In the first part, we designed the XFA form that will provide us with the print/archive view of the movies retrieved from the Movie Service. The second part will focus on the special Flex code we will need to include in the form which will ultimately be executed by Flash when it runs in the form guide which we’ll design in part 3.

Flex Code in XFA Forms

The key to today’s tutorial is understanding when and where the script you write in an XFA form (JavaScript or FormCalc) is compiled or interpreted.

Continue reading…


Posted by Stefan Cameron on November 18th, 2008
Filed under Conferences,Designer,Form Guides,Instance Manager,Scripting,Tables,Tutorials,XFA

MAX 2008 Tutorial – Part 1 – Designing the Form

This is the first part in a multi-part post series for Adobe MAX 2008 designed to show you how extend a form guide to import data from a website without using FlexBuilder. If you haven’t seen it already, I recommend you have a look at the demo on last Friday’s tutorial preview post to get a sense of what we’re going to be building. In this first part, we will build the form necessary to provide the print/archive capabilities for the Movie Catalog.

Throughout the tutorial, I will assume that you’ve used Designer already and you know about things like flowed vs positioned subforms. I will also assume that you’re familiar with Guide Builder’s interface for designing Form Guides.

Software Requirements

Before we get started, make sure you’re using Designer 8.2.1 SP1 and Guide Builder 8.2.1 SP1. You can download an evaluation version of Designer and Guide Builder when you download the Acrobat 9.0 Pro trial. If you haven’t installed SP1 yet, you can download it from here (note that you only need to install the Designer SP1 update — you don’t need Workbench or even LiveCycle ES to run through this tutorial).

If you already have Designer but you don’t have Acrobat, you can use Reader 9.0 to go through the tutorial.

Continue reading…


Posted by Stefan Cameron on November 17th, 2008
Filed under Conferences,Data Binding,Designer,Scripting,Tables,Tutorials,XFA