LCD Scripting Introduction
For each step in form processing, there is a data object model (DOM) that holds the data structures for that step.
A DOM is a representation of tree-structured data inside a computer's memory. As an ABAP developer, you can think of an internal table holding structured data that represents the hierarchy of the XML data inside a PDF form.
DOMs are responsible for maintaining internal consistency.
For instance, when a script turns on a radio button by assigning the corresponding field, all the other buttons coupled with that one are automatically turned off.
This is a matter of internal consistency and is managed by the form DOM itself.
Several DOMs are participating in the form creation process, which is managed by the XML Forms Architecture (XFA) processor.
Each time a form design is combined with data, the XML Form Object Model is used to facilitate the process of combining template and data to create the resulting form.
The Form DOM acts as a medium for combining the specific values from the XML data with the presentation rules defined by the form design.
After the Form DOM is created, the form is complete and ready for deployment to the users.
Interactive form designs may have associated data that they are merged with, but most interactive forms are designed to support user-entered data.
The Form DOM for forms with both fixed and flowable layouts looks very similar; it is one long form with no pagination.
When the data and presentation rules are applied to these types of forms, they must be formatted according to the layout information.
A Layout DOM is created from the Form DOM. It structures the form into pages and applies any other page-based rules such as page numbering, headers, and trailers.
There are several important links to pages containing valuable documentation (XFA, DOMs, scripting, eventing, etc.):
LiveCycle Designer scripting uses an event-based model that allows you to alter various aspects of objects on a form at runtime.
As a form designer, you add scripts to objects based on when you want the script to execute. For example, you might place the following script on the click event of a button object so that at runtime, when a user clicks the button, a message box appears with a message:xfa.host.messageBox (“This is a message, please fill in missing data”, “Title of box”, 3);
Scripts associated with a particular event execute whenever that event occurs. Some events can occur multiple times within the same form-filling session. For example, the following JavaScript script adds one to the current value of a numeric field:
NUMBER1.rawValue = NUMBER1.rawValue + 1;
If you add this script to the calculate event for NUMBER1, when you open the form for the first time, NUMBER1 displays the value 2. This indicates that the calculate event occurred twice in the sequence of events that occurred when the form was opened.
Some background knowledge on events: