Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Merged branch "DOC0000070" into parent

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

Structure


This widget generally has includes the following structureelements:

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

Elements 


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

  • If a widget element displays Widget elements display date and time , it is displays them in the user timezone.
  • The widget elements containing multilanguage fields and use the that contain the Translated Text  field type (such as table and column titles, choice options) display the values in the current user's locale.

Attributes


To create a dynamic form, use the following attributes:

.Enable the tag to be displayed on the portalForm nameForm nameHide the title of is 'true'. The same goes for if the isPortal attribute value is equal to 'true'. this attribute '' this attribute 'true' to make client scripts defined in the Client Script field available to use. Otherwise, their usage is prohibited

Attribute

Type

Mandatory

Description

classStringNSpecify a CSS class name defined in the CSS field isPortalBooleanNof the widget.
nameStringN

This attribute stores the form name.

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

Code Block
languagexml
title
Template example
<Form tableName="{data.table_name}" sysId="{data.record_id}" name="custom"></Form>

Then call it in the widget client script:

Code Block
languagejs
themeEclipse
title
Client script example
const builtInForm = s_widgets.getForm('custom');
await builtInForm.save();


tableNameStringYSpecify the table name.
viewStringNDefine a view 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 Use this attribute when it is impossible to use the UI actions due to any reasons (the uiActions attribute is equal set to ' false').

titleHideBooleanNSet the value to true to display the form header by default. The default value is false.
uiActionsBooleanNSet the 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 the value to false to disable the client scripts of the selected table. The default value is true.
sysidStringN

Specify the ID of the table record.

Info

The table should be specified first via the tableName attribute.

Note

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

Form example

If the sysid attribute is not set, a new record form is displayed.


Example:

Code Block
languagexml
themeEclipse
titleForm example
<Form<form
    name="leadForm"
    tableName="user" sysid="158747771611397284" view="Profile" save="Custom save button" uiActions="true" userScripts="true"></Form>
Image Removed
crm_leads"
    view="Modal Form Disqualify"
    uiActions="false"
    userScripts="true"
></form>
<div class="buttonsModalQualify">
    <button buttonType="unstyled" event-click="window.s_widget_custom.cancel()">{data.cancel}</button>
    <button disabled="{data.isDisabled}" buttonType="primary" event-click="window.s_widget_custom.save()">{data.save}</button>
</div>

The template above displays the following element on the page::

Image Added

Child tag IndicatePresence


Use the <IndicatePresence> tag with the <Form> tag to add the presence indication widget to a form.

To display the widget, the Indicate presence checkbox must be selected on the table form (the indicate_presence attribute is true).

Available attributes:

AttributeTypeMandatoryDescription
tableNameStringY

Specify the table name. This value must be the same as the value of the tableName attribute of the <Form> tag.

recordIdStringY

Specify the ID of the record. This value must be the same as the value of the sysid attribute of the <Form> tag.

Example:

Code Block
languagexml
themeEclipse
titleIndicatePresence
linenumberstrue
<IndicatePresence tableName="{data.table_name}" recordId="{data.record_id}"></IndicatePresence>

The code above displays the following element on the page:

Image Added

Table of Contents
absoluteUrltrue
classfixedCondition
printablefalse