Платформа 3V/Формы/Компоненты/Основные/Кнопка/Кнопка 'Сохранить': различия между версиями
< Платформа 3V | Формы | Компоненты | Основные | Кнопка
Перейти к навигации
Перейти к поиску
Строка 38: | Строка 38: | ||
| discriminator|| ButtonSubmitSourceEntry | | discriminator|| ButtonSubmitSourceEntry | ||
|} | |} | ||
+ | |||
+ | ===Пример=== | ||
+ | Ввод данных и сохранение их в справочнике. | ||
+ | <syntaxhighlight lang="JSON" line> | ||
+ | |||
+ | { | ||
+ | "id": 315, | ||
+ | "name": "Кнопка сохранить (ButtonSubmitSourceEntry)", | ||
+ | "description": null, | ||
+ | "title": "Пример кнопки Сохранить ButtonSubmitSourceEntry", | ||
+ | "entrySettings": null, | ||
+ | "uiSources": [ | ||
+ | { | ||
+ | "actionConfirmation": { | ||
+ | "message": null, | ||
+ | "conditionId": null | ||
+ | }, | ||
+ | "controlsValueCalculateRulesIds": [], | ||
+ | "conditionalActions": [], | ||
+ | "onBeforeClickConditionalActions": [], | ||
+ | "submitRuleIds": [], | ||
+ | "id": 100, | ||
+ | "caption": "Сохранить", | ||
+ | "enable": true, | ||
+ | "visible": true, | ||
+ | "hint": null, | ||
+ | "uiDataSource": null, | ||
+ | "doActionOnChangeValue": true, | ||
+ | "onAfterChangeValueConditionalActions": null, | ||
+ | "onAfterChangeValueByClientConditionalActions": null, | ||
+ | "rebuildDependentsObjectOnChange": false, | ||
+ | "enableRuleIds": [], | ||
+ | "visibleRuleIds": [], | ||
+ | "access": null, | ||
+ | "isValueChanged": false, | ||
+ | "expressionId": null, | ||
+ | "discriminator": "ButtonSubmitSourceEntry" | ||
+ | }, | ||
+ | { | ||
+ | "trimSpaces": false, | ||
+ | "defaultValue": null, | ||
+ | "value": null, | ||
+ | "id": 1, | ||
+ | "caption": "Новый контрагент", | ||
+ | "enable": true, | ||
+ | "visible": true, | ||
+ | "hint": null, | ||
+ | "uiDataSource": { | ||
+ | "attribute": { | ||
+ | "id": 2, | ||
+ | "discriminator": "OwnAttributeDefinitionDto" | ||
+ | }, | ||
+ | "attributeId": null, | ||
+ | "sourceId": 1, | ||
+ | "discriminator": "UiDataSourceDictionary" | ||
+ | }, | ||
+ | "doActionOnChangeValue": false, | ||
+ | "onAfterChangeValueConditionalActions": null, | ||
+ | "onAfterChangeValueByClientConditionalActions": null, | ||
+ | "enableRuleIds": [], | ||
+ | "visibleRuleIds": [], | ||
+ | "access": null, | ||
+ | "isValueChanged": false, | ||
+ | "expressionId": null, | ||
+ | "discriminator": "StringSourceEntry" | ||
+ | } | ||
+ | ], | ||
+ | "entryDataSources": [ | ||
+ | { | ||
+ | "dictionaryId": 47, | ||
+ | "hierarchyId": null, | ||
+ | "filter": null, | ||
+ | "sortingOptions": null, | ||
+ | "groupingOptions": null, | ||
+ | "dictionaryAttributes": null, | ||
+ | "defaultValue": [], | ||
+ | "defaultValueExpressionId": null, | ||
+ | "parameterId": null, | ||
+ | "dictionarySourceSelectionMode": "None", | ||
+ | "dataSourceAttributesAdditionsSettings": [], | ||
+ | "externalFileStorageUrl": null, | ||
+ | "filePrefix": null, | ||
+ | "defaultNewElementSettings": null, | ||
+ | "id": 1, | ||
+ | "name": "Список контрагентов", | ||
+ | "isReadOnly": false, | ||
+ | "dataEditRuleIds": [], | ||
+ | "beforeSaveDataActions": [], | ||
+ | "afterSaveDataActions": [], | ||
+ | "discriminator": "DictionaryDataSource" | ||
+ | } | ||
+ | ], | ||
+ | "parameters": [], | ||
+ | "binaryConditionsRules": [], | ||
+ | "submitValidateRules": [], | ||
+ | "expressions": [], | ||
+ | "controlsValueCalculateRules": [], | ||
+ | "actions": [], | ||
+ | "conditionActionIdsOnOpen": [], | ||
+ | "conditionalActions": [], | ||
+ | "selectionSets": [], | ||
+ | "reportTemplates": [], | ||
+ | "useNewDependenciesBuilder": null | ||
+ | } | ||
+ | |||
+ | </syntaxhighlight> | ||
+ | </div></div> | ||
==CustomButtonEntry== | ==CustomButtonEntry== |
Версия 08:26, 18 июня 2021
Содержание
!!!СТРАНИЦА НАХОДИТСЯ В СТАДИИ РАЗРАБОТКИ!!!
Кнопку "Сохранить" можно реализовать двумя способами:
1. кнопка ButtonSubmitSourceEntryDto.
2. кнопка CustomButtonEntry,
Обе кнопки могут содержать дополнительные действия помимо сохранения. Основным отличием является порядок сохранения данных - в кнопке ButtonSubmitSourceEntryDto нельзя управлять порядком сохранения.
ButtonSubmitSourceEntryDto
Кнопка ButtonSubmitSourceEntryDto сохраняет все значения источников, у которых свойство readOnly: false. Таким образом сохраняется все введенные в источники значения.
1 {
2 "confirmation" {...},
3 "nullable": true
4 "submitRuleIds": [],
5 "conditionalActions": [],
6 "onBeforeClickConditionalActions": [],
7 "discriminator": "ButtonSubmitSourceEntry"
8 }
Описание свойств элемента
Свойство | Описание |
---|---|
confirmation | |
nullable | |
submitRuleIds | |
conditionalActions | |
onBeforeClickConditionalActions | |
discriminator | ButtonSubmitSourceEntry |
Пример
Ввод данных и сохранение их в справочнике.
1 {
2 "id": 315,
3 "name": "Кнопка сохранить (ButtonSubmitSourceEntry)",
4 "description": null,
5 "title": "Пример кнопки Сохранить ButtonSubmitSourceEntry",
6 "entrySettings": null,
7 "uiSources": [
8 {
9 "actionConfirmation": {
10 "message": null,
11 "conditionId": null
12 },
13 "controlsValueCalculateRulesIds": [],
14 "conditionalActions": [],
15 "onBeforeClickConditionalActions": [],
16 "submitRuleIds": [],
17 "id": 100,
18 "caption": "Сохранить",
19 "enable": true,
20 "visible": true,
21 "hint": null,
22 "uiDataSource": null,
23 "doActionOnChangeValue": true,
24 "onAfterChangeValueConditionalActions": null,
25 "onAfterChangeValueByClientConditionalActions": null,
26 "rebuildDependentsObjectOnChange": false,
27 "enableRuleIds": [],
28 "visibleRuleIds": [],
29 "access": null,
30 "isValueChanged": false,
31 "expressionId": null,
32 "discriminator": "ButtonSubmitSourceEntry"
33 },
34 {
35 "trimSpaces": false,
36 "defaultValue": null,
37 "value": null,
38 "id": 1,
39 "caption": "Новый контрагент",
40 "enable": true,
41 "visible": true,
42 "hint": null,
43 "uiDataSource": {
44 "attribute": {
45 "id": 2,
46 "discriminator": "OwnAttributeDefinitionDto"
47 },
48 "attributeId": null,
49 "sourceId": 1,
50 "discriminator": "UiDataSourceDictionary"
51 },
52 "doActionOnChangeValue": false,
53 "onAfterChangeValueConditionalActions": null,
54 "onAfterChangeValueByClientConditionalActions": null,
55 "enableRuleIds": [],
56 "visibleRuleIds": [],
57 "access": null,
58 "isValueChanged": false,
59 "expressionId": null,
60 "discriminator": "StringSourceEntry"
61 }
62 ],
63 "entryDataSources": [
64 {
65 "dictionaryId": 47,
66 "hierarchyId": null,
67 "filter": null,
68 "sortingOptions": null,
69 "groupingOptions": null,
70 "dictionaryAttributes": null,
71 "defaultValue": [],
72 "defaultValueExpressionId": null,
73 "parameterId": null,
74 "dictionarySourceSelectionMode": "None",
75 "dataSourceAttributesAdditionsSettings": [],
76 "externalFileStorageUrl": null,
77 "filePrefix": null,
78 "defaultNewElementSettings": null,
79 "id": 1,
80 "name": "Список контрагентов",
81 "isReadOnly": false,
82 "dataEditRuleIds": [],
83 "beforeSaveDataActions": [],
84 "afterSaveDataActions": [],
85 "discriminator": "DictionaryDataSource"
86 }
87 ],
88 "parameters": [],
89 "binaryConditionsRules": [],
90 "submitValidateRules": [],
91 "expressions": [],
92 "controlsValueCalculateRules": [],
93 "actions": [],
94 "conditionActionIdsOnOpen": [],
95 "conditionalActions": [],
96 "selectionSets": [],
97 "reportTemplates": [],
98 "useNewDependenciesBuilder": null
99 }
CustomButtonEntry
Кнопка CustomButtonEntry требует добавить действие, которое сохраняет добавленный элемент в источнике данных.
1 {
2 "id": 1,
3 "caption": "Сохранить",
4 "nullable": true,
5 "enable": true,
6 "visible": true,
7 "hint": null,
8 "nullable": true
9 "uiDataSource": null,
10 "doActionOnChangeValue": true,
11 "onAfterChangeValueConditionalActions": null,
12 "onAfterChangeValueActions": null,
13 "onAfterChangeValueByClientConditionalActions": null,
14 "onAfterChangeValueByClientActions": null,
15 "rebuildDependentsObjectOnChange": true,
16 "enableExpressionIds": [],
17 "visibleExpressionIds": [],
18 "isValueChanged" boolean
19 "expressionId": [],
20 "controlsValueCalculateRulesIds"[],
21 "actions" [ 51, 50]
22 "onBeforeClickConditionalActions": [],
23 "onBeforeClickActions": [],
24 "submitRuleIds": [],
25 "discriminator": CustomButtonEntry,
26 }