Did you know that the list portion of a drop down list field can be displayed programmatically? You can set focus to the field and force its drop list to be displayed all in a single API call:
xfa.host.openList(@object)
xfa.host.openList(@string) -- deprecated since XFA 2.6
where @object is a reference to the drop down list field and @string is the SOM expression of the drop down list field.
xfa.host.openList(myDropDownList); // set focus/show the drop list
The second form of the API has been deprecated since XFA 2.6 which means that since Designer 8.1, it is preferred to use the first form which takes a reference to the field rather than its SOM expression.
If you’re using Designer 8.0 or earlier, you can get the SOM expression of any field by using its somExpression property:
xfa.host.openList(ddlInDesigner71.somExpression)
This works in both JavaScript and FormCalc with the same syntax.
Now if only there was a way to programmatically show the drop calendar of a date/time field…
Posted by Stefan Cameron on May 31st, 2010
Filed under
Scripting,
Tips,
Tutorials,
XFA
Many of you have been requesting some debugging features for XFA Forms (and I’m sure many more of you just haven’t voted for it yet). It so happens that Acrobat Pro has a JavaScript Debugger which can be used — to a limited extent — with XFA Forms. See John Brinkman’s post to learn more about it — thanks John!
As he puts it, there are limitations, the biggest ones of them being, in my opinion, the inability to debug script objects and the inability to retain breakpoints between debugging sessions. Nonetheless, this tool can give you way more insight than the good old “JavaScript Console + saveXML(‘pretty’)” combination can in certain cases, and it does it in a nice tree to boot!
Posted by Stefan Cameron on March 12th, 2010
Filed under
Acrobat,
Debugging,
Scripting,
Tutorials,
XFA
Paul Guerette, a colleague of mine at Adobe, will be giving a “tech talk” eSeminar on connecting forms to databases over at AcrobatUsers.com on Tuesday, March 23, 2010, at 10am PST (1pm EST).
If you have been struggling with connecting a form to a database, are wanting to know what the best practices and/or security concerns are, or have some specific questions you would like to ask, I highly recommend you attend the session. It’s free to attend (and free to become a member in order to attend)!
I’ll be answering chat questions “live” as the session unfolds. I hope you can join us!
Posted by Stefan Cameron on March 10th, 2010
Filed under
Acrobat,
Data Binding,
Designer,
Scripting,
Tutorials,
XFA
I thought I would point-out a nice improvement that was made to XFA <subform> elements back in XFA 2.8: The addition of the access property.
In days of yore, if you wanted to disable all fields and exclusion groups (for the sake of brevity, I’ll refer to these collectively as “fields” in this article) in a particular section of your form, you would’ve had to write a script that recursively drilled down into all children of that section looking for fields to disable. This is because the access attribute only applied to fields.
With this change, assuming the section in question is contained within a subform, you can now easily disable all fields contained within it simply by setting the subform‘s access attribute to “readOnly”!
Continue reading…
Posted by Stefan Cameron on March 8th, 2010
Filed under
Scripting,
Tutorials,
XFA
Last February, I announced the release of a new Designer book titled, “PDF Forms Using Acrobat and LiveCycle Designer Bible”.
Over the past few months, I had the opportunity to review it and I thought I would share my comments, with respect to the second-half of the book, which deals with LiveCycle Designer ES and XFA forms, to help you decide if it would be a good book for you*. (The first-half deals with authoring PDF forms, a.k.a. AcroForms, in Acrobat and is beyond the scope of my blog.)
Pros:
- explains the licensing agreement involved when enabling forms for Reader using Acrobat’s “Extend Features in Adobe Reader” feature (p. 268) — this is a frequently-used feature however its governing licensing agreement, seldom understood, is explained here in “plain English”;
- presents and reasons through different design approaches for a particular solution, helping the reader make an informed decision on the best course of action;
- anything and everything you could possibly want to know is dealt with in some way;
- lots of important, time-saving insights in the inline ‘notes’;
- something for everyone from beginner to advanced;
- many cross-references between various topics, making it very easy to start in any chapter and still find all the information you need.
Caution:
- risk of “information overload” — use this book as reference since it’s not a light read, though their goal is simply to present a myriad of options and let you pick the one that best suits your needs.
Overview of Topics Covered:
- all about tables (from simple layouts to advanced);
- data merging with bindings;
- Designer user interface details and lots of tips and tricks for accelerating form layout tasks;
- working with static forms (with PDF backgrounds) and dynamic forms, highlighting the differences;
- great details on all sorts of pagination options;
- lots of detail on JavaScript and FormCalc, good scripting exercises with explanations, debugging tips, table with JavaScript and equivalent FormCalc functions to make it easy to script in either language if the other is more familiar to you;
- form deployment options;
- when and how to use data connections in your forms (XML, schema, database, web service) and setting data bindings;
- great overview of LiveCycle ES, its components (e.g. LC Forms, LC Reader Extensions, LC Rights Management, LC Content Services, etc.) and what they do.
This book is available now on Amazon.com and Wiley.com and elsewhere.
* Please note that these opinions are not necessarily those of Adobe Systems Incorporated.
Posted by Stefan Cameron on November 13th, 2009
Filed under
Acrobat,
Books,
Data Binding,
Designer,
Instance Manager,
Scripting,
Tables,
XFA