FormField
The FormField is the generic definition of any user input field within the Form. Based on the configuration it represents a simple text input area, combo box or other UI elements.
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. |
defaultvaluemode | no | Attribute can be used to define when defaultvalue is populated.
|
defaultvaluemode="onload" |
editable | no | Boolean value which defines, if the FormFields within the tab are editable. Default is "true". |
|
filter | no | Filter to be used in a list view. If no operator is set, the default operator filter="ISEQUALTO" is used.
Available filters:
|
filter="ISLIKE" |
help | no | Help text describing the purpose / use of this field. | help="Date till when the ..." |
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. |
|
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. |
|
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. |
Examples for attribute "defaultvalue"
<!-- Example for a non-persisted field: -->
<FormField ... defaultvalue="SQL[SELECT NAME FROM PERSON WHERE ID={FORM.PERSON_ID}" ... />
<!-- Examples for default values (e.g. to be used in empty forms) -->
<FormField ... defaultvalue="SQL[SELECT SYSDATE FROM DUAL]" ... />
<FormField ... defaultvalue="OBJECT[classname.methodname({SESSION.SELECTION})]" ... />
<FormField ... defaultvalue="Austria"... />
<!-- Examples for PLACEHOLDER usage: -->
<FormField ... defaultvalue="{FORM.AGENCY_ID}" ... />
<FormField ... defaultvalue="{RESSOURCE.BLUBB}" ... />
Example
<!-- Combox with a list of values -->
<FormField name="COUNTRY" label="Country:" type="combobox" datatype="string" lov="LIST[Austria;Germany;Switzerland]" />
<!-- Date picker -->
<FormField name="DATE" label="Date:" type="datepicker" datatype="date" />
<!-- Input field for number with a default value of 20. -->
<FormField name="COMMENT" label="Comment:" type="textfield" datatype="number" defaultvalue="20" />