Versions Compared

Key

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

The Используйте тег <form> tag 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 has the following structure:

  1. Embedded widget containing the form elements.
  2. The header block:
    1. A header can be taken from the column with the Display by Ref attribute turned on.
  3. The section 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. The 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 in the widgets (such as properties, behavior, scalar type, and so on).

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

Attributes

To create a dynamic form, use the following attributes:

Form>, чтобы отобразить виджет формы записи с заданными необходимыми параметрами (такие, как таблица, вид формы, ID записи). Это позволяет пользователю редактировать поля, сохраняя при этом поведение обычной формы. Тег также поддерживает функциональность виджетов, добавленных на форму.

Структура


Данный виджет включает следующие элементы:

  1. Встроенный виджет, содержащий элементы формы.
  2. Блок заголовка:
  3. Блок секций:
    • Секция По умолчанию должна быть первой в списке секций, если их больше одной. 
    • Каждая секция виджета относится к соответствующей секции формы и имеет собственный заголовок.
    • Этот блок обязателен.
  4. Блок нижнего колонтитула, который может содержать UI-действия (кнопки и другое).

Элементы 


Элементы виджета формы, такие как элементы формы, могут быть разных типов. Все функции типов полей, используемые в формах, поддерживаются в виджетах (например, свойства, поведение, скалярный тип и другое).

  • Элементы виджета отображают дату и время в часовом поясе пользователя. 
  • Элементы виджета, содержащие поля типа Translated Text (например, заголовки таблиц и колонок, выбор опций) отображают значения на языке текущего пользователя.  

Атрибуты


Для создания динамической формы, используйте следующие атрибуты:

Атрибут

Тип

Обязательный

Описание

classStringНетУкажите название класса CSS, указанного в поле CSS виджета.
nameStringНет

Этот атрибут содержит название формы.

Задайте название формы через поле Шаблон, как в примере ниже: 

Attribute

Type

Mandatory

Description

classStringNSpecify a CSS class name defined in the CSS field.isPortalBooleanNTo enable the tag to be displayed on the portal, set the value true. The default value is false.nameStringN

This attribute stores the form name.

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

Code Block
languagexml
title
Form name
Шаблон
<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
Клиентский скрипт
linenumberstrue
Form name
const builtInForm = s_widgets.getForm('custom');
await builtInForm.save();


tableNameString
Y
ДаУкажите наименование таблицы
Specify the table name
.
viewString
NDefine a name of the table template view, for example, "Default"It makes sense to use this attribute when it is impossible to use the UI actions due to any reasons (the uiActions attribute is equal to
НетУкажите название вида формы таблицы, например, По умолчанию.
saveString
N

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

Нет

Добавьте на форму кнопку сохранения, добавив на нее необходимый текст (см. пример ниже).

Используйте этот атрибут, когда по каким-либо причинам невозможно использовать UI-действия (значение атрибута uiActions 

false).

titleHideBoolean
NHide the title of the form. The default value is true
Нет

Установите значение атрибута true, чтобы отразить заголовок формы. Значение по умолчанию: false.

uiActionsBoolean
N
НетУстановите значение true, чтобы сделать возможным использование UI-действий. В противном случае их использование будет запрещено (кроме кнопки Сохранить, определенной атрибутом save). 
Set 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).
userScriptsBoolean
NTo make client scripts defined in the Client Script field available to use, set this attribute value to true. Otherwise, their usage is prohibited
НетУстановите значение атрибута false, чтобы отключить клиентские скрипты выбранной таблицы. Значение по умолчанию: true.
sysidString
N
Нет
Specify the

Укажите ID

of the table record. InfoThe table should be specified first via the tableName attribute

записи таблицы. Предварительно нужно указать саму таблицу в атрибуте tableName.

Note

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

Form example

Если не указать sysid, то отображается форма создания записи.


Пример:

Code Block
languagexml
themeEclipse
titleForm example
<Form tableName="user" sysid="158747771611397284" view="Profile" save="Custom save button" uiActions="true" userScripts="true"></Form>

Image Removed

<form
    name="leadForm"
    tableName="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>

Шаблон из примера добавляет следующий элемент на страницу:

Image Added

Дочерний тег IndicatePresence


Используйте тег <IndicatePresence> в сочетании с тегом <Form>, чтобы добавить на форму виджет индикации присутствия других пользователей на записи.

Для отображения виджета, на форме таблицы должен быть установлен флажок Отображать присутствие (indicate_presence=true).

Доступные атрибуты:

АтрибутТипОбязательныйОписание
tableNameStringДа

Укажите название таблицы. Значение должно соответствовать значению атрибута tableName тега <Form>.

recordIdStringДа

Укажите ID записи таблицы. Значение должно соответствовать значению атрибута sysid тега <Form>.

Пример:

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

Шаблон из примера добавляет следующий элемент на страницу:

Image Added

Table of Contents
absoluteUrltrue
classfixedCondition
Table of Contents
absoluteUrltrue
printablefalse