Form Builder: Sections |
Content |
||||||||||||
|
Overview |
|
|
A Section represents an HTML table, table row, or div. More explicitly, a Section represents not only the fields in the Section, but the entire contiguous block of HTML that renders the table, table row, or div. A Section therefore includes both Fields and layout (rich text markup). Sections generally bound a set of related Form data.
Sections let you do things with contiguous blocks of HTML. For example, you can show/hide a Section based on some other entry on the Form (similar to JavaScript div swaps). You can also repeat a Section multiple times.
Note that this differs from showing/hiding a Group. If you hide a Group, you're hiding the fields in the Group, but not the HTML that renders the DOM structure in which those fields reside.
If you delete a Section, you delete the Fields in the section.
To make a table or table row a Section:
1. | Use the "Make Row Section" (if the Section is a table row) or "Make Table Section" (if the Section is the entire table) shortcut as shown in Form Builder Overview → Editing Frame → Menus → Table. |
2. | In the dialog, enter a Section Id. The Section and the fields within it are added to the "Sections" branch in the Objects frame. |
To make a div a Section:
1. | Use the "Make Div Section" shortcut as shown in Form Builder Overview → Editing Frame → Menus → Insert → Insert/edit panel. |
2. | In the dialog, enter a Section Id. The Section and the fields within it are added to the "Sections" branch in the Objects frame. |
3. | Select the Section in the Object frame to define Section properties. |
If you want to work with Formlets (which are added as Sections), see Form Builder Overview → Editing Frame → Toolbar → Insert Formlet.
Section Properties |
|
|
Behavior |
Property | Description | ||||||
Id | Identifier of the Section. | ||||||
Repeatable | Indicates that the Section can be duplicated. For example,
if the Section represents a table row, we provide an API (and the Insert
Button feature) that lets you dynamically add this row multiple times
in the form. Repeatable Sections are shown in blue.
For example, you can add two Button Fields that lets users add/remove new table rows. Then, use one of these methods on each button (the Insert Button feature lets you do this through the interface):
Repeating Sections are not allowed within a Repeating Section. |
||||||
Initial Repeats | Number of repeats to display when the Form is first rendered. | ||||||
Max Repeats | Maximum number of repeats to display when the Form is first rendered. | ||||||
Max Repeats Message | Message that is displayed in the eForm Manager when the maximum number of Section repeats is met. | ||||||
Locked | Prevents editing. The "Locked" property can be changed when the Section is locked. However, the "Locked" property is not changeable when the Section is from a locked Formlet. | ||||||
Separator | This applies only to repeating Sections. When a Field is in a repeating Group, its String value is a semicolon-delimetered list of the values. Changing the Section Separator changes the delimeter for this String value. | ||||||
Readonly | Determines if fields in the Section are readonly/readwrite
(Yes/No) and visible/hidden (Yes/No). This also accepts Groovy expressions
that use Fields on the Form to control Section visibility.
The "Readonly" and "Visible" properties can be changed when the Section is locked. |
||||||
Visible | |||||||
Clear Fields |
"OnHide" clears field values in the Section when the Section
is hidden.
"OnDisable" clears field values in the Section when the Section is disabled. |
Formlet |
When you add a Formlet to a Form, the Formlet is placed into a new Section. These properties identify the Formlet in the Section.
For more information, see Formlet Definitions (in Field and Formlet Definitions) and Insert Formlet (in the Form Builder Overview).
Property | Description |
From Formlet | Identifier of the Formlet. |
From Formlet Version | Version number of the Formlet. |
Locked | Specifies whether or not the Formlet is locked. |
By Reference | Specifies whether the Formlet was added to the Form by Insertion or by Reference. |
Datasource Binding |
Datasource Binding properties defined in a Section are inherited by all fields in the Section. However, field properties override Datasource Binding properites defined in a Section. This can be useful in cases such as when a Form contains Formlets and the Formlet fields have minimal Datasource Binding properties.
Property | Description | ||||||
Datasource Id | Explicitly defines the Datasource for a Section. This is required only if the Form has multiple Datasources. | ||||||
Section Repeater |
Defines the result set within the Datasource that will be used as the repeater or iterator for a repeating Section of data. The datasource result set specified here will generate the correct number of rows in a Section. This is required only if there is ambiguity regarding which result set must be used. See Using Repeating Sections to Make a Grid. You can repeat "By Primary Data", "By DataSets", "By DataItems" (default), "By Consumables", and "By QCBatchItems". Addtionally, these special Section Repeaters provide more intuitive Worksheet styles:
|
||||||
Properties depend on Datasource | See Field Binding. | ||||||
Exclude Binding Values | Excludes fields that match the Datasource Binding properties. |
About Groovy Expressions within Sections |
When Groovy Expressions are used within a Section, the Fields in the Section become arrays. Examples:
Expression | Returns... | Comments |
fields.project | String list separated by semicolons, dependent upon the number of repeats in the Section. Example: ProjA;ProjB | Good for Action processing.
Bad for expressions. |
fields.project.value | Array of Strings. |
Can reference individual values... fields.project.value[0] ...or use Groovy list processing: fields.project.value.any { it.length() == 0 } |
fields.collectiondate.value | Array of Calendar objects. | |
fields.collectiondate | String list. Example: 5/23/09 12:00 AM;6/18/09 9:30 PM |
Also:
• |
To reference other Fields in the same Section:
Use the fieldinstance Map, e.g., fieldinstance.autoreceive |
• |
To reference Fields not in the Section:
Use the normal Field syntax if the referenced Field is not in a Section itself. Use the array syntax (below) if the referenced field is in a Section. |
• |
Fields not in the Section referencing Section Fields:
Can reference a specific String instance, e.g., fields.project.value[0] or Use the String value of the array, e.g., fields.project or Use the array itself, e.g., fields.project.value |
Section Object Properties |
|
|
Objects Frame Context Menus for Sections |
Sections shown in the the Objects Frame have Context Menus that perform operations on the Section:
Right-click "Sections":
Menu Item | Description |
Expand | Expands/collapses the tree (if any Sections exist). |
Collapse |
Right-click a Section:
Menu Item | Description |
Expand | Expands/collapses the tree (if any Sections exist) |
Collapse | |
Remove Section | Removes the Section. |
Right-click a Field in a Section:
Menu Item | Description |
Add to Group | Adds the Field to a Group (if the Field is not in a Group). |
Remove from Group | Removes the Field from a Group (if the Field is in a Group). |