Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AJAX request with cyrillic symbols in response

610683Nov 30 2007 — edited Dec 3 2007
Hello.
I try to make dependent LOV witch refreshing by AJAX, and using tread http://forums.oracle.com/forums/thread.jspa?messageID=1241356 as example.

My page has tow LOV.
For first LOV added event:
onChange="get_ajax_select_xml(this);"


The following Javascript puted in the region header:

<script type="text/javascript";charset=WINDOWS-1251>
function appendToSelect(pSelect, pValue, pContent)
{
var l_Opt = document.createElement("option");
l_Opt.value = pValue;
if(document.all){/* why is ie different ask bill */
pSelect.options.add(l_Opt);
l_Opt.innerText = pContent;
}
else {
l_Opt.appendChild(document.createTextNode(pContent));
pSelect.appendChild(l_Opt);
}
}

function replace_select_list(pSelect,pXML)
{
var l_Count = pXML.getElementsByTagName("option").length;
pSelect.length = 0;
for(var i=0;i<l_Count;i++){
var l_Opt_Xml = pXML.getElementsByTagName("option");
appendToSelect(pSelect, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
}
}

function get_ajax_select_xml(pThis)
{
var HttpResult = null;
var l_Module = html_GetElement('P6_IDMODULE');
var HttpRequest = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=get_prj_modules_select',html_GetElement('pFlowStepId').value);
HttpRequest.add('GLOBAL_VARIABLE',pThis.value);
HttpResult = HttpRequest.get('XML');
replace_select_list(l_Module, HttpResult);
HttpResult = null;
}
</script>

Created Application Item:
GLOBAL_VARIABLE

Created Application process:
begin
owa_util.mime_header('text/xml;charset=WINDOWS-1251', FALSE, 'WINDOWS-1251');
htp.p('Cache-Control: no-store, no-cache, must-revalidate');
htp.p('Cache-Control: post-check=0, pre-check=0');
owa_util.http_header_close;
htp.prn('<select>');
for rec in (select id, sCaption as sCaption from REQ_Module
where idSystem = :GLOBAL_VARIABLE)
loop
htp.prn('<option value="' || rec.id || '">' || rec.sCaption || '</option>');
end loop;
htp.prn('</select>');
end;

All work correct only if field "sCaption" contains latin symbols. As soon as in field "Caption" appears a value with Cyrillic symbols, HttpResult is empty. As result after refreshing, second LOV is empty.

APEX 3.0.1
Oracle 9.2.0.7
My database charset = American_America.CL8MSWIN1251
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2007
Added on Nov 30 2007
5 comments
2,046 views