The <form> widget is a widget displaying a record form when necessary parameters (such as a table, form view, record ID) are specified. It helps to ensure user interaction with the record form, in terms of the field changes and form reaction. It also supports the functionality of widgets added to the form.

Structure


This widget generally is structured as shown below:

  1. Embedded widget containing the form elements.
  2. Form header block:
    1. The header can be taken from the column with the Display by Ref attribute turned on.
  3. Form sections block:
    1. The Default section should be the first in the section list if there is more than one.
    2. Every widget section is relevant to the appropriate form section and has its own title. 
    3. This block is mandatory.
  4. Form footer block containing UI actions (buttons and others).

Elements 


Form widget elements, like form elements, can be of different types. All field types functionality used in forms is supported there (such as properties, behavior, scalar type, and so on).

  • If the widget element displays the date and time, then it is displayed in the user timezone.
  • Widget elements containing fields that are to be multilanguage and use the Translated Text field type (such as table and column titles, choice options) display values in the current user locale.

Attributes


The components that create a dynamic form. The following attributes are applicable:

Attribute

Type

Mandatory

Description

classStringNSpecify a CSS class name defined in the CSS field.
isPortalBooleanNEnable the tag to be displayed on the portal.
nameStringN

This attribute stores the form name.

Define the form name within the template in the Template field:

Form name
<Form tableName="{data.table_name}" sysId="{data.record_id}" name="custom"></Form>

And after that, you can call it in the widget client script:

Form name
const builtInForm = s_widgets.getForm('custom');
await builtInForm.save();
tableNameStringYSpecify the table name.
viewStringNDefine a name of the table template view, for example, "Default"
saveStringN

Add a Save button on the form with the customized text (see the code example below).

It makes sense to use this attribute when UI actions using are prohibited due to any reasons (the uiActions attribute is equal to 'false').

titleHideBooleanNHide the title of the form. The default value is 'true'. The same goes for if the isPortal attribute value is equal to 'true'.
uiActionsBooleanNSet this attribute value to 'true' to make UI actions available to use. Otherwise, their usage is prohibited (except for the Save button specified by the save attribute).
userScriptsBooleanNSet this attribute value to 'true' to make client scripts defined in the Client Script field available to use. Otherwise, their usage is prohibited
sysidStringN

Specify the ID of the table record.

The table should be specified first via the tableName attribute.

Do not specify the sysid parameter for a newly created form that did not exist before.

Form example


Form example
<Form tableName="user" sysid="158747771611397284" view="Profile" save="Custom save button" uiActions="true" userScripts="true"></Form>


  • No labels