tableSuggestAjax - charset
--------------------------

         Key: TOMAHAWK-504
         URL: http://issues.apache.org/jira/browse/TOMAHAWK-504
     Project: MyFaces Tomahawk
        Type: Bug

    Versions: 1.1.4-SNAPSHOT    
    Reporter: Rumiana Panova


After adding the "charset=utf-8" in the <s:tableSuggestAjax />, the suggested 
list is displayed correctly with the needed encoding. But when I type a letter 
in cyrillic in the field in order to receive suggestion, in Internet Explorer 
it doesn't send right encoded request. The same thing works correctly in 
Firefox.

We made some experiments and here is what works for us:

function setItemsByAjax(item) { 
this.xmlreq.abort(); 
var url = "/" + this.contextId + "/ajaxServlet.do?" + encodeURI(<params>); 
this.xmlreq.open("POST", url, true); 
this.xmlreq.setRequestHeader("Content-Type", 
"application/x-www-form-urlencoded"); 
this.xmlreq.setRequestHeader("accept-charset", "UTF-8"); 
this.xmlreq.send(null); 
} 

The thing that solves really the problem in the fragment above is the 
javascript method encodeURI(). It has to be applied in the open() method of the 
XMLHttpRequest object in org\apache\myfaces\custom\dojo\resource\dojo.js (I 
applied it on 3 places): 

http.open("POST",encodeURI(url),_227); 
http.open(_21c.method.toUpperCase(),encodeURI(_22d),_227); 
_72.open("GET",encodeURI(uri),_70?true:false); 

I hope it will be implemented.

Thank's in advance!

---<--<--@

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to