From 161734f941de98d37281f15b3b8705ae38e9e9d8 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 18 Aug 2014 12:05:04 +0000 Subject: [PATCH] Handle validation_error if widget is children of a tabbox. -Fix widget with validation error does not activate its related tab. --- etemplate/js/etemplate2.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 2c8268c4c3..799495ecd1 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -948,6 +948,16 @@ function etemplate2_handle_validation_error(_type, _response) if(widget) { 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 + var tmpWidget = widget; + while(tmpWidget._parent && tmpWidget._type != 'tabbox') + { + tmpWidget = tmpWidget._parent; + } + //Acvtivate the tab where the widget with validation error is located + if (tmpWidget._type == 'tabbox') tmpWidget.activateTab(widget); + } } egw().debug("warn","Validation errors", _response.data);