From 1f86de58c8af429401ba5d87f32a9db373f4819f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 13 Feb 2013 09:03:28 +0000 Subject: [PATCH] Get message update working --- etemplate/js/etemplate2.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index ec7d4a014a..67c6b3da86 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -483,12 +483,16 @@ etemplate2.prototype.getValues = function(_root) etemplate2.prototype.refresh = function(msg, id, type) { // We use et2_baseWidget in case the app uses something like HTML instead of label - this.widgetContainer.iterateOver(function(_widget) { - if (_widget.id == "msg" || _widget.id == "message") - { - _widget.set_Value(msg); - } - }, this, et2_baseWidget); + var msg_widget = this.widgetContainer.getWidgetById("msg"); + if(msg_widget) + { + msg_widget.set_Value(msg); + msg_widget.set_disabled(msg.trim().length == 0); + + // In case parent(s) have been disabled, just show it all + // TODO: Fix this so messages go in a single, well defined place that don't get disabled + $j(msg_widget.getDOMNode()).parents().show(); + } this.widgetContainer.iterateOver(function(_widget) {