Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions _data/components/form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{
Expand Down
9 changes: 8 additions & 1 deletion _data/components/otableData/10tableExportButton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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. <br> This output is <b>deprecated</b>, use the export-function attribute instead.",
}]
18 changes: 12 additions & 6 deletions docs/aditional-information/52-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ In this section you can check the different releases of **OntimizeWeb** and its
</tr>
</thead>
<tbody>
<tr>
<td>15.4.2</td>
<td rowspan="21">15.0.0</td>
<td rowspan="21">15.0.1<br>15.0.0</td>
<td rowspan="21">15.1.3<br>15.1.2<br>15.1.1<br>15.1.0<br>15.0.1<br>15.0.0</td>
<td rowspan="21">15.1.2<br>15.1.1<br>15.1.0<br>15.0.0</td>
<td rowspan="21">15.0.3<br>15.0.2<br>15.0.1<br>15.0.0</td>
<td rowspan="21">15.1.0<br>15.0.0</td>
</tr>
<tr>
<td>15.4.1</td>
</tr>
<tr>
<td>15.4.0</td>
<td rowspan="19">15.0.0</td>
<td rowspan="19">15.0.1<br>15.0.0</td>
<td rowspan="19">15.1.3<br>15.1.2<br>15.1.1<br>15.1.0<br>15.0.1<br>15.0.0</td>
<td rowspan="19">15.1.2<br>15.1.1<br>15.1.0<br>15.0.0</td>
<td rowspan="19">15.0.3<br>15.0.2<br>15.0.1<br>15.0.0</td>
<td rowspan="19">15.1.0<br>15.0.0</td>
</tr>
<tr>
<td>15.3.5</td>
Expand Down
29 changes: 28 additions & 1 deletion docs/components/data/33-o-form.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,35 @@ Ontimize web now supports the JDBC **UUID** sql type. To indicate that a key col
</o-form>
```

## Set-value-orde r<span class='menuitem-badge'>new<span>
## Set-value-order<span class='menuitem-badge'>new<span>

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 <span class='menuitem-badge'>new<span>

**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
<o-form #form attr="customers_form_edit" ... [form-data-validation-function]="validateBeforeSave"></form>
```
```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 }
}
```
Loading