Controls (sometimes called
fields) comprise the visual and interactive content of an
interactive form. Multiple controls can be added to a
section and moved/scaled to create the desired visual design. Some controls may simply display content (labels, images, etc) while others can capture content as well (text fields, dropdowns, date pickers, etc).
The available controls are displayed in the toolbox area of the
Form Designer. These include:
- Standard controls
- Label - Typically used to label another field that accepts input, but can also be used to display titles and content from a record.
- Text field - Captures a single line of text. Includes basic constraints and formatting.
- Text area - Captures a block of text spanning over multiple lines.
- Date field - Captures a date using an interactive picker.
- Dropdown field - Displays a set of choices in a dropdown, optionally allowing text entry.
- Check box - Simple mechanism for a Yes/No value.
- Radio button group - As an alternative to a dropdown field, shows a set of choices as radio buttons, arranged either horizontally or vertically on the page.
- Table - Works in conjunction with a custom table definition to allow the user to view/edit a table of values.
- Custom field - Used when binding to a workgroup field that provides its own selection logic. Intended for advanced users.
- Graphics
- Box - Draws a box in a variety of different styles.
- Image - Displays an image resource.
- Navigation
- Back/Next/Finish/Cancel buttons - Usually placed in the header/footer of the form, moves between pages and/or completes the form.
- Hyperlink - Powerful mechanism that can navigate to a URL, page or open another form and utilise its output.
- Pickers
- Address picker - Allows the user to assign an existing contact address to an Address record (selecting from a list of choices).
- Communications picker - Allows the user to assign an existing communications entry to a Communications record (selecting from a list of choices).
- Contact picker - Allows the user to assign an existing contact to a Contact record (using the ContactsLaw search).
- File picker - Allows the user to assign an existing file to a File record (using the ContactsLaw search).
- Document picker - Allows the user to assign an existing document to a Document record (using the ContactsLaw search).
- Postcode picker - Uses the ContactsLaw search to look up the postcode for a suburb, or vice-versa.
- Web
- Captcha - Used to protect web forms against bots and automation by third parties.
- File upload field - Allows the user to select a file to upload. When the form completes, the contents of the file is used to populate a Document record.
Properties
All controls have
Value property which contains the information displayed on (or contained within) the control. When controls are used in
rules, it is this property which is examined during evaluation. You can choose a default value for each control during the design stage.
Most controls which accept input (except those where it is impossible for the field to be empty) have a
Required property, which allows you to mark the field as required/optional. When the user attempts to navigate to the next
page, the navigation will be cancelled if there are any required fields which are still empty.
Note: The 'Required' property is ignored if the control is hidden (either as a result of being in a hidden section on a page, or on a hidden page). |
Other properties include:
- Name - Each control has a unique name, with a default name assigned automatically. You should choose a suitably descriptive name for any control you intend to refer to elsewhee in the form (such as in a rule).
- Comments - Allows the user(s) responsible for the design to further annotate the use/purpose of the control.
- Directive type - Allows the value of the control to be passed between forms or other activities in ContactsLaw, or used in document creation. Unlike records, controls are not included in the list of directives by default.
Bindings
A control's
Binding describes the relationship between the control and a
record, thus determining how it gets its initial value and what data is updated when the user enters a new value into the control. When setting a binding, you must specify the record and property to associate with the control.
You can also specify a binding mode; a 1-way binding simply populates the control with the value from the record, whereas a 2-way binding writes the control's value back to the record. 2-way binding is the most common choice, however some properties (e.g. the constructed forms of a contact's name) only support 1-way binding.
When a control is bound to a record, the value from the record is copied onto the control when the page is first displayed. In 2-way mode, any change to the value of the control will cause the record to be updated. When the user navigates to the next page, the records are updated one final time.
Note: If the type of data stored in the control is different to the type of data stored in the record's property (e.g. a Text field control and a Yes/No property) then the binding may not be valid. The property will not be updated and an error message will be displayed when the user enters a new value into the control. |
Dropdown fields with bindings
If a
Dropdown field is bound to a property on a record, ContactsLaw may provide a default set of choices. When the
Use default choices property of the control is set to 'Yes', it is not necessary to add the choices manually. In some cases, the default choices may be the only way to access certain items from ContactsLaw (such as
referral sources).
Binding to a custom table
When a Table control is bound to a workgroup field of type 'Table' (and associated with a custom table definition), the control is populated accordingly. You cannot meaningfully bind a Table control to any other property, nor can you meaningfully bind any other type of control to such a field. To edit individual entries in a table, use a table entry record and bind controls to this instead.
Hyperlinks
(Main article)
Hyperlink controls serve several purposes on interactive forms. They can be used in the traditional sense to navigate to a URL (web address, e-mail link or ContactsLaw URL), to navigate to another page on the current form, or to open a separate form.
In the latter case, hyperlinks allow you to modularise and reuse forms for common purposes; such as creating contacts. The current form can pre-populate records/controls on the new form, and vice-versa. It can also provide an entry point for a form with no activity of its own.
Tab order
At run-time, the tab order for the controls on a form is determined based on the position and size of each control. As the user tabs between fields, input focus will move from left-to-right and then top-to-bottom. Horizontally adjacent controls are regarded as being on the same line, even if only part of their height overlaps.
See also