Using get_AJAX_SELECT_XML causes form to "hang" in IE but notin FIREFOX
afret1Jul 28 2006 — edited Dec 20 2006I have 2 fields on a form that are coordinated to make use of the javascript call of get_AJAX_SELECT_XML,
P118_CLONE_DEPT
P118_CLONE_POS
The HTML form element attributes for P118_CLONE_DEPT are:
onchange="get_AJAX_SELECT_XML(this,'P118_CLONE_POS')"
The LOV is supposed to be automatically populated for P118_CLONE_POS once you select a department for P118_CLONE_DEPT.
The code hangs in IE at the same place, but never hangs in Firefox. If you let the browser sit, control seems to eventually come back, but it may take 5 to 6 minutes - most users would bail out well before 5 minutes have elapsed. I have no clue what is causing this.
This is triggered by picking a deparment that has 9 positions, then a deparment that has 0 positions and then repeating it all over again. ie.
dept 854 with 9 positions
dept 857 with 0 positions
dept 854 with 9 positions
dept 857 with 0 positions
....
Here is the function with alerts:
function get_AJAX_SELECT_XML(pThis,pSelect){
var l_Return = null;
var l_Select = html_GetElement(pSelect);
alert('1in get_AJAX_SELECT_XML value of item is ('+ pThis.value + ')' );
var get = new
htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=clone_Select_XML',0);
alert('2in get_AJAX_SELECT_XML value of item is ('+ pThis.value + ')' );
get.add('TEMP_POS_TYPE_CD_DEPT',pThis.value);
alert('3in get_AJAX_SELECT_XML value of item is ('+ pThis.value + ')' );
//alert('2 in get_AJAX_SELECT_XML value of item is ('+ pThis.value + ')' );
gReturn = get.get('XML');
alert('4in get_AJAX_SELECT_XML value of item is ('+ pThis.value + ')' );
if(gReturn && l_Select){
var l_Count = gReturn.getElementsByTagName("option").length;
alert('5in get_AJAX_SELECT_XML l_Count is' + l_Count );
l_Select.length = 0;
alert('6in get_AJAX_SELECT_XML l_Count is' + l_Count );
for(var i=0;i<l_Count;i++){
alert('7in get_AJAX_SELECT_XML i is' + i );
var l_Opt_Xml = gReturn.getElementsByTagName("option");
alert('8in get_AJAX_SELECT_XML about to call appendToSelect');
appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
alert('8in get_AJAX_SELECT_XML i is' + i );
}
}
alert('9in get_AJAX_SELECT_XML i is' + i );
get = null;
alert('10in get_AJAX_SELECT_XML i is' + i );
}
It hangs just after alert # 3 is displayed on the screen. Does this mean the call " gReturn = get.get('XML');" is taking a while to process? Is it my browser? Once control is returned, the position LOV is filled in correctly.