Overview

A SubForm control inserts inside a master DynaForm another DynaForm, already created in the project, adding it as another row of the design and displaying its entire design when running a case. To add this control in the DynaForm, drag the following icon from the left panel and drop it in the designer.

The Select Control message box opens with the list of all existing DynaForms in the project. Select from this list the DynaForm which will be added in the design.

The sub DynaForm will be included inside the design displaying all its rows.

The subform control does not allow editing the form inserted within the design (take into account this consideration from version 3.0.1.5). It is mandatory to change the original DynaForm to view the changes reflected in all the subforms that use the DynaForm.

When rendering the DynaForm (in the preview or when running cases), subforms are added as normal content of the form.

To work with subforms take into account the following:

  • The same form can only be used once in the same Dynaform (In order to don’t duplicate the use of variables and ids).
  • The subform can’t be edited in the form. It is display as read only. To modify the form, open it directly in the designer. The changes made in the form must be reflected automatically in all the subform fields that reference this form.
  • Only one level of nesting is allowed. A subform can’t contain subforms.
  • A form can contain multiple subforms (which must be different).
  • In order to avoid the duplication of variables and id’s with subforms, a validation must be executed in order to alert the user of existing duplicated variables/ids. The designer must define if the design can continue with the duplicated variables/ids.

Warning: Take care when upgrading to ProcessMaker 3.0.1.5. Because of the changes made in the functionality of the subforms, it is no longer possible to customize the subforms when they are added in the design of the DynaForm (their properties are in view mode so no changes can be made). If you had customized the subforms in previous versions of ProcessMaker (like adding customized JavaScript, modifying the controls, etc.) these changes will be lost.

Note: In version 3.0.1.4 it is possible to delete the rows and controls of the subform, but take into account that if the original form is modified, it will be rendered in the main form just as it is designed, so the changes will not have any effect.

Properties

Click on any light gray space of the subform to view and work with its properties.

Property Description
Type form (readonly)
Grid Store This property allows relating a grid variable to a subform field so many instances of the same subform can be added in the form.

Available version: From version 3.0.1.5 to 3.0.1.7.

Note: This property only related a grid variable with a subform control and is no longer available from version 3.0.1.8 on.

ID The same id (unique HTML identifier) as the parent form (readonly).
Name

[Readonly]

The same name as the parent form.
Description

[Readonly]

The same description set when the parent form was created. This property describes what the DynaForm is about.
Mode

[Readonly]

Display mode of the parent form:

  • edit: the control is enabled for edition when it is rendered.
  • view: the control can only be viewed when it is rendered. The content can’t be edited.
  • disabled: the control is displayed as disabled. The control is displayed in gray in order to indicate the disabled mode. The content can't be edited either.
JavaScript

[Readonly]

In subforms, the JavaScript code is concatenated to the parent form thus this property is readonly.
External Libs

[readonly]

Area where the external libraries of the parent form are shown.

Note: Take into account that if the Sub DynaForm has JavaScript code associated to it in its configuration, it will execute every time the DynaForm is loaded.

Subform Properties

Subforms are basically Dynaforms embedded inside another form. The properties of a subform are inherited of the original DynaForm and these properties can not be modified. However, subform controls have one additional property explained in the next section.

Grid Store

Available on: ProcessMaker 3.0.1.5 to 3.0.1.7. This property is no longer available from version 3.0.1.8 on.

This property allows relating a subform control with a grid variable, so many instances of the subform can be added in the form - one row after another - as rows of a grid.

Note: At the moment, this property only relates a grid variable with a subform control. This option was added for experimental purposes in version 3.0.1.5, but it will be removed from version 3.0.1.8 on.

To relate the grid variable to the subform control, select the subform in the designer.

Check the grid store property and the variable and variable data type will be displayed below.

Select or create a new grid variable to associate it to the subform.

Wait for next releases to have this property working completely.

Subform Control Example

For this example add a "Subform" control by dragging and dropping it from the Web Controls located on the left hand panel.

Immediately after the control is added a window will appear where all the Dynaforms created can be found. Select one of the Dynaforms that will appear as a Subform.

Once a subform is selected it will be added into the current form as seen in the image below. Adding a subform can sometimes be easier than exporting and importing a Dynaform. Also the form will not rendered if there are controls which have the same id. So take this into consideration when using subforms.

Click on any grey space on the subform to display its properties on the left hand panel. The properties for this control are mostly disabled as seen in the image below

Once the properties are displayed the only property which can be changed is the "grid store". When this property is checked then a variable can be added by clicking on the underlined ellipsis ... and a new window will be shown.

Create a "subform" variable which will be type "Grid" as seen in the image below.

The result of this action is the following: