FormTable
The FormTable is a specific implementation of a FormField representing a table within a Form. Columns within the FormTable are defined by FormTableField's.
In a FormTable you can also define FormAction's to maniplulate the content of the table.
Attributes
Attribute | Mandatory | Description | Example |
---|---|---|---|
name | yes | Unique name of the form within the FormList (has to be written in UPPERCASE letters and must not contain any special characters). | name="General" |
authorization | no | Only users with the appropriate Role/Claim are authorized to view/process the element. |
|
datatype | yes | The type of the data to visualize. Following datatypes are available:
|
datatype="string" |
defaultvalue | no | Attribute can be used to set a value for:
|
Examples can be found here. |
editable | no | Boolean value which defines, if the FormFields within the tab are editable. Default is "true". |
|
idfield | no | Definition of the primary key in the LoV statement. | idfield="ID" |
label | no | Label to show in the Form. | label="Start date" |
lov | no | More details can be found here. | Examples can be found here. |
maxlength | no | Defines the maximum input length for a FormField. The size of the FormField depends on the defined maxlength. | maxlength="10" |
override | no | Boolean value if it is set true the defaultvalue always replaces the value of the data record. Note: It only works if the field is defined as visible="false". | override="true" |
persisted | no | Boolean value which defines if the FormField should be stored to the data source or is only a temporary object for visualization. | persisted="false" |
required | no | Boolean value which defines if the FormField may contain NULL values or not. |
|
rowcount | no | Defines the number of lines which are shown in the table. If the number of records exceeds the rowcount, a pagination is added to the FormTable automatically. | rowcount="10" |
saveinsession | no | Attribute to persist (after a submit) the actual FormField value in a session variable which can be referenced later (for example, from another Form). By defining saveinsession="true" it will be stored under "FORMNAME.FORMFIELDNAME" into the session. Alternative you can define your own name. NOTE: selectionmode="multiple" will store a coma separated string of the ID values. Otherwise, the actual ID value will be persisted in the SEC_SESSION table. |
|
selectionmode | no | Defines how many items may be selected in a formTable. Possible values are:
|
selectionmode="none" |
sqlselect | no | The attribute sqlselect should be used if the FormField is a non-persisted field and therefore not filled from the form table. While sqlselect is used to fill the FormField in the List-Controller, the defaultvalue is the corresponding statement in the Form-Controller.SQL-statements (as well as parts of SQL-statements) can be used. There are several possibilities:
|
|
template | no | Defines which template should be used for the FormField representation. | template="MyTextFieldTemplate" |
type | yes | A FormField can receive the following types: autocomplete: database-driven element to generate a list of values after user input.
|
type="combobox" |
validation | no | The validation of user input. More information can be found here. | Examples can be found here. |
validationmessage | no | Message to show when the validation of the field fails. | validationmessage="The input must be numeric!" |
visible | no | Defines the visibility of the field The result has to deliver true or false. More details can be found here. | Examples can be found here. |
Example
<FormTable name="COPYRIGHTGRID" label=" " datatype="string" idfield="ID" required="false" persisted="false" selectionmode="single"
rowcount="8" lov="SQL[Select ID,NAME, COPYRIGHTTEXT From RPI_COPYRIGHT Order By UPPER(NAME)]"
defaultvalue="SQL[Select COPYRIGHT_ID From RPI_COPYRIGHT_FEATURE Where FEATURE_ID = {FORM.Id}]">
<FormTableField name="NAME" label="Name" width="150" />
<FormTableField name="COPYRIGHTTEXT" label="Text" width="300" />
<FormAction name="EditCopyright" label="Edit" action="SCRIPT[IG.openSimpleModalForm({form:'RPI_COPYRIGHT',id:{ROW.ID}, closeAction: 'reloadFields', closeActionParam:['COPYRIGHTGRID']})]" type="row" image="ig-icon-edit" />
</FormTable>