Show TOC

Designing Dynamic FormsLocate this document in the navigation structure

Use

Dynamic forms are composite forms that allow you to present varying amounts of data to users. These forms change their layout according to the data they receive from the prefilling services at the time of rendering, so each separate request for form generation produces a form with a different length or content. For example, you may need to display all purchase order records from a repository. Since the order count is variable, you can accommodate it using a dynamic form.

In addition, you can change the layout of dynamic forms at runtime using the script functionality embedded in the form template. For example, you can add or remove rows from a table using the controls provided.

Prerequisites

You have basic knowledge of how to create composite forms.

For more information, see Creating and Configuring Forms .

Procedure

The following procedure describes the basic steps for creating dynamic forms. For more information about the process of form creation and configuration, see the Adobe LiveCycle Designer's online help under Working with Form Designs → Creating forms with a dynamic layout.

  1. Create a new form.
    • If you want to design the form template separately and then use it in Guided Procedures (GP), open the Adobe LiveCycle Designer and choose File  → New…  → New Blank Form.
    • If you want to design the form template on the fly, you can create it using the available GP design time functionality.

      For more information, see Creating Form Objects in the GP Design Time .

  2. Enable preview options.

    To be able to preview and test your dynamic form in the Adobe LiveCycle Designer environment, you need to navigate to File   → Form Properties… and on the Defaults tab page select:

    • Interactive Formfrom the Preview Type dropdown box
    • Dynamic PDF from the XDP Preview Format dropdown box
  3. Create the form layout.

    You design the layout of the form by inserting relevant form elements into the body pages of the document.

    Field-Based Dynamic Form Schema-Based Dynamic Form
    Insert non-repeatable form fields

    You create all the relevant fields on the form by dragging and dropping them from the Library palette onto the form's body page.

    Since you do not have a previously defined data schema, you should manually create and configure the form elements you need.

    You create all the relevant fields on the form by dragging and dropping them from the Data View palette onto the form's body page.

    The Data View palette holds a Data Connection with the structure of the form context that you have built previously.

    For more information, see Building and Using a Form Context .

    Insert dynamic form fields

    Dynamic elements that have to appear repeatedly, depending on the occurrences of the data structure or attribute they are bound to, must be placed in tables and subforms.

    Tip
    • From the Standard tab of the Library palette, insert a table using drag and drop.
    • Insert non-repeatable elements in the static rows as described above.
    • Set the labels of its header and footer row cells (if available).
    • Insert dynamic elements for all rows that should replicate:

    From the Library palette, drag and drop elements into the cells of the table.

    From the Data View palette, drag and drop attributes and structures into the cells of the table. Mapping is performed automatically.

    In the Hierarchy palette, select the row that contains the dynamic input. On the Object  → Binding tab, set the Repeat Row for Each Data Item indicator to specify that the row should replicate for each new data record.

    You may also specify a minimum and maximum number of occurrences.

     

    Make sure that the names of the fields, and of the row itself, match the corresponding data attributes and structures from the form context.

    For example, if an instance of the structure purchase_orders is used to fill in a row in a table, you must name this row purchase_orders as well.

    1. Insert dynamic elements for navigation and control
      Note Adobe LiveCycle Designer has some predefined components which you can use in your forms. These components allow the user to change dynamically the layout of the form at runtime.
      Tip

      From the Web Dynpro Native tab in the Library palette, drag and drop the Subform Instance Controls: Insert Remove Move element into the last cell of the repeatable row in the table. The element allows you to add, remove or move rows within the table. This is possible because of the FormCalc script attached to the click events of the buttons.

    Note

    If you want to insert background objects, or objects that need to appear on every page of the form (such as current date, current page, logos, watermarks, headers and footers), you should modify the master page.

  4. To save and upload the form to GP design time, choose Save.
  5. To close the Adobe LiveCycle Designer, choose Close.

    If you have designed a field-based form template, you need to define mappings between the template fields and the form context.

    More information: Adding Content to Field-Based Templates

    Note

    Each table or subform that corresponds to a dynamic (repeatable) data structure is presented as a list, that is, at the time of rendering it appears as many times as there are instances of the particular structure.

  6. On the Configuration screen of the form creation wizard, make sure you set the Dynamic Form indicator.

    For more information about configuration options, see Configuring Form's Use and Data Processing Options .

Example

The following example illustrates the basic layout of a dynamic composite form that is to be filled with purchase order records from a repository.

The form template consists of:
  • Background objects - for example, a company logo
  • Static labels - Order No, Description, Quantity (in the table heading)
  • Non-repeatable fields - Name, Address, E-Mail
  • Dynamic fields - the first row of the table for which the Repeat Row for Each Data Item indicator is set
  • Dynamic controls - buttons from the Web Dynpro Native set of predefined components
  • Submit button - depending on your choice, the submission channel may be HTTP or SMTP