Author: jleroux
Date: Sun Jan 9 16:57:32 2011
New Revision: 1056977
URL:
http://svn.apache.org/viewvc?rev=1056977&view=revLog:
A patch from Leon "i18n problem in auto-completed dropdown box: display not correct characters but html entities" (
https://issues.apache.org/jira/browse/OFBIZ-4101) - OFBIZ-4101
If there're chinese characters contained in a description field of a lookup textbox with auto-complete feature enabled, then what I can get from auto-completed dropdown box is not unstandable chinese but messed html entities such as "氨" blah blah.
Thanks to Dukian for quick testing!
Modified:
ofbiz/trunk/framework/images/webapp/images/selectall.js
Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=1056977&r1=1056976&r2=1056977&view=diff==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/selectall.js Sun Jan 9 16:57:32 2011
@@ -396,7 +396,7 @@ function ajaxAutoCompleter(areaCsvString
for (var i = 0; i < numAreas * 3; i = i + 3) {
var url = areaArray[i + 1] + "?" + areaArray[i + 2];
var div = areaArray[i];
- // create a seperate div where the result JSON Opbject will be placed
+ // create a separated div where the result JSON Opbject will be placed
if ((jQuery("#" + div + "_auto")).length < 1) {
jQuery("<div id='" + div + "_auto'></div>").insertBefore("#" + areaArray[i]);
}
@@ -409,9 +409,14 @@ function ajaxAutoCompleter(areaCsvString
data: {term : request.term},
success: function(data) {
//update the result div
- jQuery("#" + div + "_auto").html(data)
- // autocomp is the JSON Object which will be used for the autocomplete box
- response(autocomp);
+ jQuery("#" + div + "_auto").html(data);
+ if (typeof autocomp != 'undefined') {
+ jQuery.each(autocomp, function(index, item) {
+ item.label = jQuery("<div>").html(item.label).text();
+ })
+ // autocomp is the JSON Object which will be used for the autocomplete box
+ response(autocomp);
+ }
}
})
},