You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2007/02/18 23:14:25 UTC
svn commit: r509012 -
/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js
Author: weber
Date: Sun Feb 18 14:14:24 2007
New Revision: 509012
URL: http://svn.apache.org/viewvc?view=rev&rev=509012
Log:
TOBAGO-279 (InputSuggest did not work)
Modified:
myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js
Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js?view=diff&rev=509012&r1=509011&r2=509012
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/inputSuggest.js Sun Feb 18 14:14:24 2007
@@ -37,6 +37,9 @@
Effect.Appear(update,{duration:0.15});
};
this.element.autoCompleter = this;
+ // tobago-ajax request is prefixed by <size> + Tobago.Updater.CODE_SUCCESS
+ // controls.js:Autocompleter can't handle this, so this must be removed.
+ this.REGEX_SUCCSESS = new RegExp("^[0-9a-f]*?\\s*?" + Tobago.Updater.CODE_SUCCESS);
LOG.debug("new Autocompleter for " + this.element.id);
},
@@ -71,8 +74,8 @@
onComplete: function(request) {
// LOG.debug("get response = " + request.responseText);
var responseText = request.responseText;
- if (responseText.substring(0, Tobago.Updater.CODE_SUCCESS.length) == Tobago.Updater.CODE_SUCCESS) {
- responseText = responseText.substring(20);
+ if (responseText.match(this.REGEX_SUCCSESS)) {
+ responseText = responseText.substring(responseText.indexOf(Tobago.Updater.CODE_SUCCESS) + 20);
// LOG.debug("responseText = " + responseText);
this.updateChoices(responseText);
this.resetWidth();