From 9d2b8de5699f51ca253bac7d188ac109b3aa84b2 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 30 Mar 2007 13:09:22 +0000 Subject: Fixed #557. --- framework/Web/Javascripts/js/debug/ajax.js | 35 ++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'framework/Web/Javascripts/js/debug') diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js index 4b20a8de..1016f435 100644 --- a/framework/Web/Javascripts/js/debug/ajax.js +++ b/framework/Web/Javascripts/js/debug/ajax.js @@ -1978,6 +1978,7 @@ Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete, initialize : function(options) { this.options = options; + this.hasResults = false; this.baseInitialize(options.ID, options.ResultPanel, options); Object.extend(this.options, { @@ -2014,12 +2015,38 @@ Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete, Prado.Callback(this.options.EventTarget, options, null, this.options); }, - onComplete : function(request, boundary) + /** + * Overrides parent implements, don't update if no results. + */ + selectEntry: function() + { + if(this.hasResults) + { + this.active = false; + this.updateElement(this.getCurrentEntry()); + } + }, + + onComplete : function(request, boundary) { var result = Prado.Element.extractContent(request.transport.responseText, boundary); - if(typeof(result) == "string" && result.length > 0) - this.updateChoices(result); - } + if(typeof(result) == "string") + { + if(result.length > 0) + { + this.hasResults = true; + this.updateChoices(result); + } + else + { + this.active = false; + this.hasResults = false; + this.hide(); + } + } + }, + + }); /** -- cgit v1.2.3