Only valid inside a table control, the row
control can define the
table's row template, or its header
and footer
.
Usage
... <row> <declarations> declarations </declarations> <validation> validation </validation> content </row>
Fields
Field | Description |
---|---|
id |
Identifies the control when it is referenced in data-binding queries, reports, and workflow scripts. |
Traits
Trait | Description |
---|---|
declarations |
A collection of zero or more variable declarations (let elements) that can be referenced in solution-wide query expressions. |
validation |
A collection of zero or more validation rules (validator elements) that evaluate user input in the control at
runtime, and prevent the user from submitting the form if the |
content (required) | A list of zero or more cell controls. |
Remarks
A row control's only valid child elements are one or more cell controls, one for every column in the given row.
If a header
or footer
is also declared for the
table
, the number of cell
controls in the
header
, footer
, and row template row
controls must match.
When you declare a row
control as the content of the
table
(that is, not inside a header
or
footer
), it functions as a template, in conjunction with its parent table
control's recordset property: the parent table
control
will render a row
control for each record in the recordset. You can use the
iterator variable named in the table
control's record
field
to access the fields of the current record in the template.
The removebutton control is valid only as a descendant of the row template. It renders a button in the form that removes its closest ancestor row when the user clicks it.
... <chapter title="A row template with a removebutton control"> <table recordset='{TABLE things ("gizmo"; "doodad"; "thingy")}' record="thing"> <row> <cell> <textview text='{thing.things}'/> </cell> <cell> <removebutton text='{"Remove the " || thing.things || " row."}'/> </cell> </row> </table> ...
When the user clicks one of the removebutton
s, its closest ancestor
row
is removed from the parent table
's
recordset
.
Sample
<form id='rowSample' menuName='How the row template works' platforms='web' xmlns='http://schemas.mobilengine.com/fls/v1'> <chapter title='A row template with hardcoded values'> <table recordset='{TABLE reduplication1, reduplication2, reduplication3 ("Nitty-Gritty", "Fuzzy-Wuzzy", "Humpty-Dumpty"; "Okey-dokey", "Helter-skelter", "Mumbo-jumbo"; "Willy-nilly", "Itsy-bitsy", "Razzle-dazzle")}' record='re'> <header> <row> <cell> <textview text='This hard-coded label appears once in the form'/> </cell> </row> </header> <row> <cell> <textview text='The number of times this label appears depends on the recordset query'/> </cell> </row> </table> </chapter> <chapter title='A row template with data-bound values'> <table recordset='{TABLE reduplication1, reduplication2, reduplication3 ("Nitty-Gritty", "Fuzzy-Wuzzy", "Humpty-Dumpty"; "Okey-dokey", "Helter-skelter", "Mumbo-jumbo"; "Willy-nilly", "Itsy-bitsy", "Razzle-dazzle")}' record='r'> <header> <row> <cell> <textview text='This cell in the template references the reduplication1 column' /> </cell> <cell> <textview text='This cell in the template references the reduplication2 column' /> </cell> <cell> <textview text='This cell in the template references the reduplication3 column' /> </cell> </row> </header> <row> <cell> <textview text='{r.reduplication1}'/> </cell> <cell> <textview text='{r.reduplication2}'/> </cell> <cell> <textview text='{r.reduplication3}'/> </cell> </row> </table> </chapter> </form>
The
table
control at the top displays the same content in all its rows; the
bottom table
control displays the 3-column, 3-row table expression that is
data-bound into it.
Because none of the controls in the form above has an identifier, a workflow script running in the Mobilengine Cloud would only be able to access the metadata of its submission.