Generating Program-Driven Adode Form Layout

Prerequisites

You are familiar with the XFA specification.

More information: Adobe home page, Adobe XML Forms Architecture (XFA) page (using search.adobe.com )

Context

Instead of creating form layouts manually in Adobe LiveCycle Designer , you can use a program interface (API) to have them generated by the program. The program-driven form layout can be displayed in Adobe LiveCycle Designer .

Procedure

  1. To define a form layout, use the interfaces from package SAXFT.
  2. To generate the root node, use CREATE_OBJECT to instantiate an object from the class CL_SXFT_TEMPLATE.

    For this object, you can call the method GET_FACTORY() to get a factory object.

  3. To generate the subsequent XFA elements, use a create method of the factory object to instantiate the corresponding object.
    • Structure the XFA document as follows:

      • Use set methods to set simple attributes and send the attribute value to the VALUE parameter in quotation marks.

      • Use set methods to set attributes that are themselves elements, and send an object to the VALUE parameter that represents the attribute (and the new element).

      • Set child elements by using the method IF_SXFT_NODE~APPEND_CHILD(NEW_CHILD). The interface IF_SXFT_NODE is included in all interfaces that represent XFA elements.

    • Use grouping interfaces for attributes that are set often:

      • The interface IF_SXFT_ALIGNMENT groups the set methods for the attributes VALIGN and HALIGN. This interface is included in all interfaces that represent elements with these attributes.

      • The interface IF_SXFT_MEASUREMENT groups the set methods for attributes X, Y, W, H, and layout. This interface is included in all interfaces that represent elements with these attributes.

Example

For an example implementation, see the program RSXFT_XFT_API_DEMOII.

This program generates a form template (XFA file) that includes the following: header and footer, a static text, a selection list, option fields, a text input field, and a pushbutton. The generation of the form layout does not include any data binding (no form template context).