Dynaform controls¶
A control is one element of a form: a field, a button, a label or a grid. Each control that holds data is bound to a variable, and that binding is what carries the value into the case.
The control types¶
The current editor palette offers these controls:
| Family | Controls |
|---|---|
| Text and input | Textbox, Textarea, Hidden |
| Choices | Dropdown, Checkbox, Checkgroup, Radio |
| Date and time | Datetime |
| Lookup | Suggest |
| Grid | Grid |
| Files and media | FileUpload, File (hidden), Link, Image |
| Static text | Title, Subtitle, Label |
| Buttons | Submit, Button |
| Structure | Panel, Subform |
The palette labels are the ones the editor shows. In particular:
- Textbox is the single-line text field; Textarea is the multi-line field.
- Radio is the single-choice control; Checkgroup accepts several answers.
- Datetime handles date and time; there is no separate date-only palette item.
- FileUpload is the upload control. The single-file File control is hidden in the current palette; use FileUpload.
Binding a control to a variable¶
- Drop the control on the canvas.
- Open its properties and set the variable it writes to.
- Save the form.
A control without a variable renders and validates, but its value goes nowhere: it is not stored in the case and no condition can read it. That is the usual reason a form "loses" a field.
The variable can exist before the control or be created while you build the form; what matters is that the name matches exactly.
What the value looks like in a condition¶
The value is read with a prefix: @@ as text, @% as a whole
number, @# as a decimal. The same variable can be read differently in two
conditions, so the prefix belongs to the condition, not to the control.
Two families need care:
- Controls with several answers (Checkgroup) and grids hold more than one value. Compare one member, not the whole thing.
- Files hold the reference to the uploaded file, not its contents.
Options from a database¶
Textbox, Textarea, Hidden, Dropdown, Checkgroup, Radio, and Suggest can take their options from a database connection instead of a fixed list. The control stores the connection and the query; the values are resolved when the form opens.
Showing and hiding a control¶
Any control can be shown or hidden by a condition, without touching the stored value. See Conditions → Form conditions for the rules and the events that trigger them.
Related¶
- Dynaform editor — the palette, the canvas and the preview.
- Control properties — the panel every control shares.
- Variables — what the controls read and write.
- Conditions — how a value is read in an expression.