From 7f21c60a0636016d7e370e6ab7078840ceaa938a Mon Sep 17 00:00:00 2001 From: Patricia Martinez <32088627+patricia-martinez-imatia@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:58:36 +0100 Subject: [PATCH 1/3] o-table-export-button: New input `export-function` (#662) --- _data/components/otableData/10tableExportButton.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/_data/components/otableData/10tableExportButton.yml b/_data/components/otableData/10tableExportButton.yml index 76ae92564..4b21ffdc1 100644 --- a/_data/components/otableData/10tableExportButton.yml +++ b/_data/components/otableData/10tableExportButton.yml @@ -25,9 +25,16 @@ attributes: [{ default: "", required: "", description: "Indicates the exportation type", +},{ + name: "export-function", + type: "() => void", + default: "", + required: "", + since: "15.4.2", + description: "Custom function to be executed when the export button is clicked", }] outputs: [{ name: "onClick", - description: "Event triggered when the export button is clicked" + description: "Event triggered when the export button is clicked.
This output is deprecated, use the export-function attribute instead.", }] From f5dc5c8545d589f4c776e58ed133218b2345f6b5 Mon Sep 17 00:00:00 2001 From: Patricia Martinez <32088627+patricia-martinez-imatia@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:59:07 +0100 Subject: [PATCH 2/3] Updated the versions table up to 15.4.2 (#661) --- docs/aditional-information/52-versions.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/aditional-information/52-versions.md b/docs/aditional-information/52-versions.md index e7a922969..56ea3a0bb 100644 --- a/docs/aditional-information/52-versions.md +++ b/docs/aditional-information/52-versions.md @@ -28,14 +28,20 @@ In this section you can check the different releases of **OntimizeWeb** and its + + 15.4.2 + 15.0.0 + 15.0.1
15.0.0 + 15.1.3
15.1.2
15.1.1
15.1.0
15.0.1
15.0.0 + 15.1.2
15.1.1
15.1.0
15.0.0 + 15.0.3
15.0.2
15.0.1
15.0.0 + 15.1.0
15.0.0 + + + 15.4.1 + 15.4.0 - 15.0.0 - 15.0.1
15.0.0 - 15.1.3
15.1.2
15.1.1
15.1.0
15.0.1
15.0.0 - 15.1.2
15.1.1
15.1.0
15.0.0 - 15.0.3
15.0.2
15.0.1
15.0.0 - 15.1.0
15.0.0 15.3.5 From cb71f9389d4930764fc3a46c8c9f151c0784bf83 Mon Sep 17 00:00:00 2001 From: Patricia Martinez <32088627+patricia-martinez-imatia@users.noreply.github.com> Date: Fri, 7 Feb 2025 12:17:57 +0100 Subject: [PATCH 3/3] New input form-data-validation-function (#660) * New input form-data-validation-function * Fixed typo --- _data/components/form.yml | 6 +++++ docs/components/data/33-o-form.component.md | 29 ++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/_data/components/form.yml b/_data/components/form.yml index de15dfb84..c386946e5 100644 --- a/_data/components/form.yml +++ b/_data/components/form.yml @@ -180,6 +180,12 @@ attributes: [ required: "", since: "15.1.0", description: "Fields attr's order that ​​will be be set values in this order in the form, separated by ';'" +},{ + name: "form-data-validation-function", + type: "(data: any) => OFormValidation", + since: "15.4.2", + description: "Executes the before-save validation callback for insert and update operations." + }] outputs: [{ diff --git a/docs/components/data/33-o-form.component.md b/docs/components/data/33-o-form.component.md index b5ffd0ee1..fba2cb38e 100644 --- a/docs/components/data/33-o-form.component.md +++ b/docs/components/data/33-o-form.component.md @@ -316,8 +316,35 @@ Ontimize web now supports the JDBC **UUID** sql type. To indicate that a key col ``` -## Set-value-orde rnew +## Set-value-ordernew The o-form doesn't guarantee the order in which the fields will be filled. If a field value is required by another one (as a parent-key of a form field, an error could be produced). In principle, the default filler should be right in most cases, but with this parameter the filler order can be established. It isn't necessary to establish every field attribute. The attributes specified in this parameter are filled first. + +## Input form-data-validation-function new + +**Ontimize Web** allows to execute the before-save validation callback for insert and update operations in `o-form`. + +If the validation fails, it displays an alert with the corresponding messages and prevents the operation from proceeding. + +```html + +``` +```ts +@ViewChild('form') form: OFormComponent; + +validateBeforeSave= (data: any): OFormValidation => { + + const errors: string[] = []; + + if (this.form.isInInsertMode() && !data.name) { + errors.push('Name is required.'); + } + + if (this.form.isInUpdateMode() && data.status === 'inactive') { + errors.push('Cannot update a record with inactive status.'); + } + return { valid: errors.length === 0, title: ' Inactive status ', messages: errors } +} +```