From 3c96eb9ce6f2d4a12f492e2ecf7376151cb30b09 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 14 Jul 2022 11:37:29 -0600 Subject: [PATCH] Fix webcomponents with validation errors did not get tab activated --- api/js/etemplate/etemplate2.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index 611904166b..42242ac821 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -1561,22 +1561,22 @@ export class etemplate2 { (widget).showMessage(_response.data[id], 'validation_error'); - // Handle validation_error (messages coming back from server as a response) if widget is children of a tabbox - let tmpWidget = widget; - while(tmpWidget.getParent() && tmpWidget.getType() != 'tabbox') - { - tmpWidget = tmpWidget.getParent(); - } - //Acvtivate the tab where the widget with validation error is located - if(tmpWidget.getType() == 'tabbox') - { - (tmpWidget).activateTab(widget); - } } else if(typeof widget.set_validation_error == "function") { widget.set_validation_error(_response.data[id]); } + // Handle validation_error (messages coming back from server as a response) if widget is children of a tabbox + let tmpWidget = widget; + while(tmpWidget.getParent() && tmpWidget.getType() != 'tabbox') + { + tmpWidget = tmpWidget.getParent(); + } + //Acvtivate the tab where the widget with validation error is located + if(tmpWidget.getType() == 'tabbox') + { + (tmpWidget).activateTab(widget); + } } egw().debug("warn", "Validation errors", _response.data); }