Stefan Cameron on Forms
Building intelligent forms using Adobe LiveCycle Designer

'XFA' Category Archive

Creating and Loading Data Nodes

Have you ever needed to create data nodes in the Data DOM on-the-fly? How about a need to parse XML obtained from a web service data connection in order to find a value for some property? If that’s the case, then you’ll find-out how to do it in this article.

Creating Data Nodes

In a similar article, John Brinkman showed how to create form variable nodes at runtime however what’s not obvious about data nodes is that you don’t create them using

a class name of your choice.

For example, say you wanted to create the following data node structure:

<custom>
    <message>Hello World!</message>
</custom>

 

Continue reading…


Posted by Stefan Cameron on June 1st, 2009
Filed under CM,Data Binding,Instance Manager,Scripting,Tables,Tutorials,XFA

Tip: Default Subform Binding Options

Did you know that you can specify the default data binding for new subforms in the “Tools menu > Options dialog > Data Binding panel”?

 

The default setting is “Normal” which means that all new subforms you insert from the Object Library with have their “Object palette > Binding tab > Default Binding property” set to “Normal” which means implicit binding using the subform’s name.

Setting this to “None” will result in all new subforms having a default binding of “None” which means they don’t participate in data binding by default. Since subforms are often needed purely for form layout, I find it’s safer to use this setting because I know inserting new subforms will not affect any bindings I have already setup in my form. (While it’s true that unnamed subforms don’t participate in data binding, I always name my subforms for clarity and scripting purposes so setting the binding to “None” ensures they don’t mess with data binding unless I want them to.)


Posted by Stefan Cameron on April 23rd, 2009
Filed under Data Binding,Designer,Tips,XFA

XFA 3.0 Specification Available

The recent update to Acrobat/Reader 9.1 supports XFA 3.0. Unfortunately, the currently-shipping version of LiveCycle Designer (even with its update) won’t author/support more than XFA 2.8 until the next release. The comments for the XFA 3.0 spec indicate that “there will be releases [of LiveCycle Form Server and LiveCycle Designer] for XFA 3.1 and they will also handle 3.0.”

There are still some great things worth mentioning about XFA 3.0. In particular,

  • new “inactive” value for the presence attribute which, when set on a container (e.g. subform), “prevents the container and its contents from processing calculations, validations, and events”;
  • enhancements to events framework now permits event propagation upward to parent objects — this is great because you can now implement validation code on a subform for all of its children instead of having validation code in each child, for example;
  • new validation events and global validation handling control — this should address a lot of the current issues with form validation.

It looks like John Brinkman will be detailing these new features, and perhaps others, soon.

August 18, 2009 — Added links to new XFA 3.0 topics on FormFeed.


Posted by Stefan Cameron on March 24th, 2009
Filed under Acrobat,Events,XFA

Pre-Process Web Service Responses

Connecting to a web service usually means using import bindings to capture the response but what if you wanted to do something special with the response? What if the response wasn’t exactly correct for merging into your form (e.g. you just wanted to extract a part of the response and push it into your form somewhere)?

You could still use import bindings (set using the “Object palette > Bindings tab > Import/Export Bindings property”) but then you might have to hide most — or all — of those fields if you didn’t want to expose them. You would wait for the web service data connection to execute, then find the field that contains the piece of data you want and set it where it needs to go. This isn’t ideal, however, because Designer doesn’t expose any events, in the Script Editor, that would let you know that you now have data from the web service response in your form. Furthermore, having those extra fields around could add a lot of unnecessary weight (read: file size).

Continue reading…


Posted by Stefan Cameron on March 23rd, 2009
Filed under Data Binding,Designer,Events,Scripting,Tutorials,XFA

Expandable Table with Totals

It seems that calculating totals in an expandable table with a dynamic/repeatable row is a hot topic lately so I thought I would post a tutorial on how to build a simple table which represents a purchase order where you can add and remove line items and various totals are automatically calculated.

Before we get started, you’ll need Designer 7.1 and Acrobat/Reader 7.0.5 at minimum to run through this tutorial. I will be using Designer 8.2 and Acrobat/Reader 9.0 to do the tutorial so it’s possible some of the UI may have changed slightly since the 7.1/7.05 versions.

Continue reading…


Posted by Stefan Cameron on February 25th, 2009
Filed under Data Binding,Designer,FormCalc,Scripting,Tables,Tutorials,XFA