diff --git a/src/Wizard.unit.js b/src/Wizard.unit.js index 0c77c07b88..02692eccd3 100644 --- a/src/Wizard.unit.js +++ b/src/Wizard.unit.js @@ -421,8 +421,10 @@ describe('Wizard tests', () => { setTimeout(() => { checkPage(2); const errors = wizard.errors; - assert.equal(errors.length, 1, 'Must err before next page'); - assert.equal(errors[0].message, 'Text Field is required'); + assert.equal(errors.length, 2, 'Must err before next page'); + errors.forEach((error) => { + assert.equal(error.ruleName, 'required'); + }); done(); }, 300) }, 300) diff --git a/src/components/_classes/nested/NestedComponent.js b/src/components/_classes/nested/NestedComponent.js index d087629ba8..834e169b83 100644 --- a/src/components/_classes/nested/NestedComponent.js +++ b/src/components/_classes/nested/NestedComponent.js @@ -766,7 +766,7 @@ export default class NestedComponent extends Field { validationProcessor({ scope, data, row, instance, component }, flags) { const { dirty } = flags; if (this.root.hasExtraPages && this.page !== this.root.page) { - instance = this.getComponentById(component.id); + instance = this.getComponent(component.path); } if (!instance) { return; diff --git a/test/forms/wizardWithRequiredFields.js b/test/forms/wizardWithRequiredFields.js index 5f66463713..e32bf2f564 100644 --- a/test/forms/wizardWithRequiredFields.js +++ b/test/forms/wizardWithRequiredFields.js @@ -18,6 +18,33 @@ export default { 'key': 'textField', 'type': 'textfield', 'input': true + }, + { + 'label': 'Data Grid', + 'reorder': false, + 'addAnotherPosition': 'bottom', + 'layoutFixed': false, + 'enableRowGroups': false, + 'initEmpty': false, + 'tableView': false, + 'validateWhenHidden': false, + 'key': 'dataGrid', + 'type': 'datagrid', + 'input': true, + 'components': [ + { + 'label': 'Text Field', + 'applyMaskOn': 'change', + 'tableView': true, + 'validate': { + 'required': true + }, + 'validateWhenHidden': false, + 'key': 'textField', + 'type': 'textfield', + 'input': true + } + ] } ], 'input': false,