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 220.127.116.11). 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.
Note: In version 18.104.22.168 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.
Click on any light gray space of the subform to view and work with its properties.
|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 22.214.171.124 to 126.96.36.199.
Note: This property only related a grid variable with a subform control and is no longer available from version 188.8.131.52 on.
|ID||The same id (unique HTML identifier) as the parent form (readonly).|
[Readonly]The same name as the parent form.
[Readonly]The same description set when the parent form was created. This property describes what the DynaForm is about.
Display mode of the parent form:
[readonly]Area where the external libraries of the parent form are shown.
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.
Available on: ProcessMaker 184.108.40.206 to 220.127.116.11. This property is no longer available from version 18.104.22.168 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 22.214.171.124, but it will be removed from version 126.96.36.199 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: