As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Read-Only TopicGo
Search
Notify
Admin
New PM!
Member posted September 19, 2007 02:39 PM
When using a xmlHttp request to call a focexec I get erratic results. The launch page contains 5 list boxes all chained and stacked on top of each other. Populating the first is very fast and efficient. Clicking on the first list box to drill down to the second list box brings erratic results The code is basically the same. function url_build_index(report,list_box){ var work_Available_Object = document.getElementById("lb_index"); var work_org_Object = document.getElementById("eb_org"); var work_sec_Object = document.getElementById("eb_work_sec"); var work_ss_Object = document.getElementById("eb_work_ss"); var work_u_Object = document.getElementById("eb_work_u"); var work_su_Object = document.getElementById("eb_work_su"); var work_ssu_Object = document.getElementById("eb_work_ssu"); var url_Object = document.getElementById("eb_url"); work_Available_Object.options.length=0; var org_param=work_org_Object.value; var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking"; url +="&ORG=" + work_org_Object.value ; url +="&SEC=" + work_sec_Object.value ; url +="&SS=" + work_ss_Object.value ; url +="&U=" + work_u_Object.value ; url +="&SU=" + work_su_Object.value ; url +="&SSU=" + work_ssu_Object.value ; url_Object.value=url; // Open a connection to the server xmlHttp.open("GET", url, true); // Setup a function for the server to run when it's done xmlHttp.onreadystatechange = updatePage_index; // Send the request xmlHttp.send(null); } /////////////////////// function updatePage_index() { if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200 ) { var responseXML = xmlHttp.responseXML; var trs = responseXML.getElementsByTagName("tr"); document.getElementById("lb_index").options.length = 0; for (r = 0; r < trs.length; r++) { var tds = trs[r].getElementsByTagName("td"); document.getElementById("lb_index").options[r] = new Option(tds[1].firstChild.nodeValue, tds[0].firstChild.nodeValue); } } } } Has anyone else
Posts: 13 | Location: Los Angeles, Ca | Registered: November 08, 2005
IP
Virtuoso Bob, a couple of questions:
1) IE or Firefox?
2) How many xmlHttp objects are you creating.
3) Are the boxes chained to populate only when a selection is made on the parent?
If you post more code, including the on change events etc. then we could help more.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004
IP
Member Sec, ss , u, su, and ssu listboxes are chained in this order. If the index list box is clicked for display, it is also chained. This is done simply by reloading the list box using the selections made, if any in the other 5 chained list boxes. var xmlHttp = false; try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { xmlHttp = false; } } if (!xmlHttp && typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); } //////////////////////////////////// function lb_sect_onchange(ctrl) { var sect_Selected_Object = document.getElementById("lb_sect"); var amp_sect_Selected_Object = document.getElementById("eb_sect"); var amp_work_sec_Selected_Object = document.getElementById("eb_work_sec"); var work_sec_param=""; var radio_checked=radio2_checked() ; var item_selected="n" ; var sec_param=""; var sec_param_wrk=""; var sec_hold_wrk=""; var sec_hold_text=""; var select_cnt=0 ; var all_selected='n'; for(i=0;i { if(sect_Selected_Object.options[i].selected == true && select_cnt==0) { select_cnt++ ; sec_param_wrk=sect_Selected_Object.options[i].text; (sec_param=(sec_param_wrk.slice(0,2))); if (sec_param=='AL') { sec_param='FOC_NONE'; work_sec_param='FOC_NONE'; all_selected='y'; } else { (sec_param = "'" + (sec_param_wrk.slice(0,2)) + "'" ); (work_sec_param = (sec_param_wrk.slice(0,2))); (all_selected='n'); } } else if(sect_Selected_Object.options[i].selected == true && select_cnt > 0 && all_selected != 'y') { select_cnt++ ; sec_param_wrk=sect_Selected_Object.options[i].text; (sec_param=sec_param + " OR " + "'" + (sec_param_wrk.slice(0,2)) + "'" ); (work_sec_param=work_sec_param + " OR " +(sec_param_wrk.slice(0,2))); } } amp_sect_Selected_Object.value=sec_param; amp_work_sec_Selected_Object.value=work_sec_param; var eb_index_ck_Object = document.getElementById("eb_index_ck"); var eb_val=eb_index_ck_Object.value ; //clear_lb_index(); if (eb_val=='y') { load_lb_index(); alert("Please wait until the Index list box is repopulated"); } //////// if (radio_checked > 1) { lb_sect_run(); } } function lb_sect_run(ctrl) { var ssect_Selected_Object = document.getElementById("lb_ssect"); clear_lb_ss(); var report="load_sub_section"; var list_box="lb_ssect"; //populate_eb_work(list_box); url_build_ss(report,list_box); var cnt=ssect_Selected_Object.length; if (cnt > 1) { e=document.getElementById("lb_sect"); e.style.visibility = 'hidden'; e=document.getElementById("tx_sect"); e.style.visibility = 'hidden'; e=document.getElementById("lb_ssect"); e.style.visibility = 'visible'; e.selectedIndex = -1; e=document.getElementById("tx_ssect"); e.style.visibility = 'visible'; ssect_Selected_Object.selectedIndex = -1; } else { alert("Nothing available for this selection"); } } /////////////////////////////////// function lb_ssect_onchange(ctrl) { /////////////////////////////////// var radio_checked=radio2_checked() ; var ssect_Selected_Object = document.getElementById("lb_ssect"); var amp_ssect_Selected_Object = document.getElementById("eb_ssect"); var amp_work_ss_Selected_Object = document.getElementById("eb_work_ss"); var work_ss_param=""; var item_selected="n" ; var ssec_param=""; var secc_param_wrk=""; var select_cnt=0 ; var all_selected='n'; for(i=0;i { if(ssect_Selected_Object.options[i].selected == true && select_cnt==0) { select_cnt++ ; ssec_param_wrk=ssect_Selected_Object.options[i].text; (ssec_param=(ssec_param_wrk.slice(0,2))); if (ssec_param=='AL') {ssec_param='FOC_NONE'; work_ss_param='FOC_NONE'; all_selected='y'; } else { (ssec_param= "'" + (ssec_param_wrk.slice(5,7)) + "'"); (work_ss_param=(ssec_param_wrk.slice(5,7))); all_selected='n'; } } else if(ssect_Selected_Object.options[i].selected == true && select_cnt > 0 && all_selected != 'y') { select_cnt++ ; ssec_param_wrk=ssect_Selected_Object.options[i].text; (ssec_param=ssec_param + " OR " + "'" + (ssec_param_wrk.slice(5,7)) + "'"); (work_ss_param=work_ss_param + " OR " + (ssec_param_wrk.slice(5,7))); } } amp_ssect_Selected_Object.value=ssec_param; amp_work_ss_Selected_Object.value=work_ss_param; /////// var eb_index_ck_Object = document.getElementById("eb_index_ck"); var eb_val=eb_index_ck_Object.value ; //clear_lb_index(); if (eb_val=='y') { load_lb_index(); alert("Please wait until the Index list box is repopulated"); } var cnt=1; if (radio_checked > 2) { lb_ssect_run(); } } function lb_ssect_run(ctrl) { var unit_Selected_Object = document.getElementById("lb_unit"); var report="load_unit"; var list_box="lb_unit"; //populate_eb_work(list_box); url_build_u(report,list_box); //pausecomp(2000) ; var cnt=unit_Selected_Object.length; if (cnt > 1) { e=document.getElementById("lb_ssect"); e.style.visibility = 'hidden'; e=document.getElementById("tx_ssect"); e.style.visibility = 'hidden'; e=document.getElementById("lb_unit"); e.style.visibility = 'visible'; e.selectedIndex = -1; e=document.getElementById("tx_unit"); e.style.visibility = 'visible'; unit_Selected_Object.selectedIndex = -1; } else { alert("Nothing available for this selection"); } } ////////////////////////////////// function lb_unit_onchange(ctrl) { ////////////////////////////////// //alert("List Box lb_unit clicked"); var radio_checked=radio2_checked() ; var unit_Selected_Object = document.getElementById("lb_unit"); var amp_unit_Selected_Object = document.getElementById("eb_unit"); var amp_work_u_Selected_Object = document.getElementById("eb_work_u"); var work_u_param=""; var item_selected="n" ; var unit_param=""; var unit_param_wrk=""; var select_cnt=0 ; var all_selected='n'; for(i=0;i { if(unit_Selected_Object.options[i].selected == true && select_cnt==0) { select_cnt++ ; unit_param_wrk=unit_Selected_Object.options[i].text; unit_param=(unit_param_wrk.slice(0,2)); if (unit_param=='AL') {unit_param='FOC_NONE'; work_u_param='FOC_NONE'; all_selected='y'; } else { (unit_param= "'" + (unit_param_wrk.slice(10,12)) + "'"); (work_u_param= (unit_param_wrk.slice(10,12))); all_selected='n'; } } else if(unit_Selected_Object.options[i].selected == true && select_cnt > 0 && all_selected != 'y') { select_cnt++ ; unit_param_wrk=unit_Selected_Object.options[i].text; (unit_param=unit_param + " OR " + "'" + (unit_param_wrk.slice(10,12)) + "'"); (work_u_param=work_u_param + " OR " + (unit_param_wrk.slice(10,12))); } } amp_unit_Selected_Object.value=unit_param; amp_work_u_Selected_Object.value=work_u_param; /////// var eb_index_ck_Object = document.getElementById("eb_index_ck"); var eb_val=eb_index_ck_Object.value ; //clear_lb_index(); if (eb_val=='y') { load_lb_index(); alert("Please wait until the Index list box is repopulated"); } if (radio_checked > 3) { lb_unit_run(); } } function lb_unit_run(ctrl) { var sunit_Selected_Object = document.getElementById("lb_sunit"); var report="load_sub_unit"; var list_box="lb_sunit"; //populate_eb_work(list_box); url_build_su(report,list_box); //pausecomp(2000) ; var cnt=sunit_Selected_Object.length; if (cnt > 1) { e=document.getElementById("lb_unit"); e.style.visibility = 'hidden'; e=document.getElementById("tx_unit"); e.style.visibility = 'hidden'; e=document.getElementById("lb_sunit"); e.style.visibility = 'visible'; e.selectedIndex = -1; e=document.getElementById("tx_sunit"); e.style.visibility = 'visible'; sunit_Selected_Object.selectedIndex = -1; } else { alert("Nothing available for this selection"); } } /////////////////////////////////// function lb_sunit_onchange(ctrl) { /////////////////////////////////// //alert("List Box lb_sunit clicked"); var radio_checked=radio2_checked() ; var sunit_Selected_Object = document.getElementById("lb_sunit"); var amp_sunit_Selected_Object = document.getElementById("eb_sunit"); var amp_work_su_Selected_Object = document.getElementById("eb_work_su"); var work_su_param=""; var item_selected="n" ; var sunit_param=""; var sunit_param_wrk=""; var select_cnt=0 ; var all_selected='n'; for(i=0;i { if(sunit_Selected_Object.options[i].selected == true && select_cnt==0) { select_cnt++ ; sunit_param_wrk=sunit_Selected_Object.options[i].text; sunit_param=(sunit_param_wrk.slice(0,2)); if (sunit_param=='AL') {sunit_param='FOC_NONE'; work_su_param='FOC_NONE'; all_selected='y'; } else { (sunit_param= "'" + (sunit_param_wrk.slice(15,17)) + "'"); (work_su_param= (sunit_param_wrk.slice(15,17))); all_selected='n'; } } else if(sunit_Selected_Object.options[i].selected == true && select_cnt > 0 && all_selected != 'y') { select_cnt++ ; sunit_param_wrk=sunit_Selected_Object.options[i].text; (sunit_param=sunit_param + " OR " + "'" + (sunit_param_wrk.slice(15,17)) + "'"); (work_su_param=work_su_para + " OR " + (sunit_param_wrk.slice(15,17))); } } amp_sunit_Selected_Object.value=sunit_param; amp_work_su_Selected_Object.value=work_su_param; //////// var eb_index_ck_Object = document.getElementById("eb_index_ck"); var eb_val=eb_index_ck_Object.value ; //clear_lb_index(); if (eb_val=='y') { load_lb_index(); alert("Please wait until the Index list box is repopulated"); } if (radio_checked > 4) { lb_sunit_run(); } } function lb_sunit_run(ctrl) { var ssunit_Selected_Object = document.getElementById("lb_ssunit"); var report="load_sub_sub_unit"; var list_box="lb_ssunit"; //populate_eb_work(list_box); url_build_ssu(report,list_box); //pausecomp(2000) ; var cnt=ssunit_Selected_Object.length; if (cnt > 1) { e=document.getElementById("lb_sunit"); e.style.visibility = 'hidden'; e=document.getElementById("tx_sunit"); e.style.visibility = 'hidden'; e=document.getElementById("lb_ssunit"); e.style.visibility = 'visible'; e.selectedIndex = -1; e=document.getElementById("tx_ssunit"); e.style.visibility = 'visible'; ssunit_Selected_Object.selectedIndex = -1; } else { alert("Nothing available for this selection"); } } //////////////////////////////////// function lb_ssunit_onchange(ctrl) { var ssunit_Selected_Object = document.getElementById("lb_ssunit"); var amp_ssunit_Selected_Object = document.getElementById("eb_ssunit"); var amp_work_ssu_Selected_Object = document.getElementById("eb_work_ssu"); var work_ssu_param=""; var ssunit_param=""; var ssunit_param_wrk=""; var select_cnt=0 ; var all_selected='n'; for(i=0;i { if(ssunit_Selected_Object.options[i].selected == true && select_cnt==0) { select_cnt++ ; ssunit_param_wrk=ssunit_Selected_Object.options[i].text; ssunit_param= (ssunit_param_wrk.slice(0,2)) ; if (ssunit_param=='AL') {ssunit_param='FOC_NONE'; all_selected='y'; } else { (ssunit_param="'" + (ssunit_param_wrk.slice(20,22))+ "'"); (work_ssu_param=(ssunit_param_wrk.slice(20,22))); all_selected='n'; } } else if(ssunit_Selected_Object.options[i].selected == true && select_cnt > 0 && all_selected != 'y') { select_cnt++ ; ssunit_param_wrk=ssunit_Selected_Object.options[i].text; (ssunit_param=ssunit_param + " OR " + "'" + (ssunit_param_wrk.slice(20,22)) + "'"); (work_ssu_param=work_ssu_param + " OR " + (ssunit_param_wrk.slice(20,22))); } } amp_ssunit_Selected_Object.value=ssunit_param; amp_work_ssu_Selected_Object.value=work_ssu_param; var eb_index_ck_Object = document.getElementById("eb_index_ck"); var eb_val=eb_index_ck_Object.value ; //clear_lb_index(); if (eb_val=='y') { load_lb_index(); alert("Please wait until the Index list box is repopulated"); } } /////////////////////////// function url_build_sec(report,list_box){ var work_Available_Object = document.getElementById("lb_work"); var work_org_Object = document.getElementById("eb_org"); work_Available_Object.options.length=0; var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking"; url +="&ORG=" + work_org_Object.value ; // Open a connection to the server xmlHttp.open("GET", url, true); // Setup a function for the server to run when it's done xmlHttp.onreadystatechange = updatePage_sec; // Send the request xmlHttp.send(null); } /////////////////////// function updatePage_sec() { var work_Available_Object = document.getElementById("lb_sect"); if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200 ) { var responseXML = xmlHttp.responseXML; var trs = responseXML.getElementsByTagName("tr"); document.getElementById("lb_sect").options.length = 0; (work_Available_Object.options[work_Available_Object.length++].text="ALL"); var i=0; for (r = 0; r < trs.length; r++) { var tds = trs[r].getElementsByTagName("td"); i++; document.getElementById("lb_sect").options[i] = new Option(tds[1].firstChild.nodeValue, tds[0].firstChild.nodeValue); } } } } /////////////////////////// function url_build_ss(report,list_box){ var work_Available_Object = document.getElementById("lb_ssect"); var work_org_Object = document.getElementById("eb_org"); var work_sec_Object = document.getElementById("eb_work_sec"); work_Available_Object.options.length=0; var org_param=work_org_Object.value; var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking"; url +="&ORG=" + work_org_Object.value + "&"; url +="&SEC=" + work_sec_Object.value; // Open a connection to the server xmlHttp.open("GET", url, true); // Setup a function for the server to run when it's done xmlHttp.onreadystatechange = updatePage_ss; // Send the request xmlHttp.send(null); } /////////////////////// function updatePage_ss() { var work_Available_Object = document.getElementById("lb_ssect"); if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200 ) { var responseXML = xmlHttp.responseXML; var trs = responseXML.getElementsByTagName("tr"); document.getElementById("lb_ssect").options.length = 0; (work_Available_Object.options[work_Available_Object.length++].text="ALL"); var i=0; for (r = 0; r < trs.length; r++) { var tds = trs[r].getElementsByTagName("td"); i++; document.getElementById("lb_ssect").options[i] = new Option(tds[1].firstChild.nodeValue, tds[0].firstChild.nodeValue); } } } } /////////////////////////// function url_build_u(report,list_box){ var work_Available_Object = document.getElementById("lb_unit"); var work_org_Object = document.getElementById("eb_org"); var work_sec_Object = document.getElementById("eb_work_sec"); var work_ss_Object = document.getElementById("eb_work_ss"); work_Available_Object.options.length=0; var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking"; url +="&ORG=" + work_org_Object.value + "&"; url +="&SEC=" + work_sec_Object.value + "&"; url +="&SS=" + work_ss_Object.value; // Open a connection to the server xmlHttp.open("GET", url, true); // Setup a function for the server to run when it's done xmlHttp.onreadystatechange = updatePage_u; // Send the request xmlHttp.send(null); } /////////////////////// function updatePage_u() { var work_Available_Object = document.getElementById("lb_unit"); if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200 ) { var responseXML = xmlHttp.responseXML; var trs = responseXML.getElementsByTagName("tr"); document.getElementById("lb_unit").options.length = 0; (work_Available_Object.options[work_Available_Object.length++].text="ALL"); var i=0; for (r = 0; r < trs.length; r++) { var tds = trs[r].getElementsByTagName("td"); i++; document.getElementById("lb_unit").options[i] = new Option(tds[1].firstChild.nodeValue, tds[0].firstChild.nodeValue); } } } } /////////////////////////// function url_build_su(report,list_box){ var work_Available_Object = document.getElementById("lb_sunit"); var work_org_Object = document.getElementById("eb_org"); var work_sec_Object = document.getElementById("eb_work_sec"); var work_ss_Object = document.getElementById("eb_work_ss"); var work_u_Object = document.getElementById("eb_work_u"); work_Available_Object.options.length=0; var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking"; url +="&ORG=" + work_org_Object.value + "&"; url +="&SEC=" + work_sec_Object.value + "&"; url +="&SS=" + work_ss_Object.value + "&"; url +="&U=" + work_u_Object.value; //alert("url = " + url ); // Open a connection to the server xmlHttp.open("GET", url, true); // Setup a function for the server to run when it's done xmlHttp.onreadystatechange = updatePage_su; // Send the request xmlHttp.send(null); } /////////////////////// function updatePage_su() { var work_Available_Object = document.getElementById("lb_sunit"); if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200 ) { var responseXML = xmlHttp.responseXML; var trs = responseXML.getElementsByTagName("tr"); document.getElementById("lb_sunit").options.length = 0; (work_Available_Object.options[work_Available_Object.length++].text="ALL"); var i=0; for (r = 0; r < trs.length; r++) { var tds = trs[r].getElementsByTagName("td"); i++; document.getElementById("lb_sunit").options[i] = new Option(tds[1].firstChild.nodeValue, tds[0].firstChild.nodeValue); } } } } /////////////////////////// function url_build_ssu(report,list_box){ var work_Available_Object = document.getElementById("lb_ssunit"); var work_org_Object = document.getElementById("eb_org"); var work_sec_Object = document.getElementById("eb_work_sec"); var work_ss_Object = document.getElementById("eb_work_ss"); var work_u_Object = document.getElementById("eb_work_u"); var work_su_Object = document.getElementById("eb_work_su"); work_Available_Object.options.length=0; var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking"; url +="&ORG=" + work_org_Object.value + "&"; url +="&SEC=" + work_sec_Object.value + "&"; url +="&SS=" + work_ss_Object.value + "&"; url +="&U=" + work_u_Object.value + "&"; url +="&SU=" + work_su_Object.value; // Open a connection to the server xmlHttp.open("GET", url, true); // Setup a function for the server to run when it's done xmlHttp.onreadystatechange = updatePage_ssu; // Send the request xmlHttp.send(null); } /////////////////////// function updatePage_ssu() { var work_Available_Object = document.getElementById("lb_ssunit"); if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200 ) { var responseXML = xmlHttp.responseXML; var trs = responseXML.getElementsByTagName("tr"); document.getElementById("lb_ssunit").options.length = 0; (work_Available_Object.options[work_Available_Object.length++].text="ALL"); var i=0; for (r = 0; r < trs.length; r++) { var tds = trs[r].getElementsByTagName("td"); i++; document.getElementById("lb_ssunit").options[i] = new Option(tds[1].firstChild.nodeValue, tds[0].firstChild.nodeValue); } } } } /////////////////////////// function url_build_index(report,list_box){ var work_Available_Object = document.getElementById("lb_index"); var work_org_Object = document.getElementById("eb_org"); var work_sec_Object = document.getElementById("eb_work_sec"); var work_ss_Object = document.getElementById("eb_work_ss"); var work_u_Object = document.getElementById("eb_work_u"); var work_su_Object = document.getElementById("eb_work_su"); var work_ssu_Object = document.getElementById("eb_work_ssu"); var work_ssu_Object = document.getElementById("eb_work_ssu"); var work_user_Object = document.getElementById("eb_user"); var url_Object = document.getElementById("eb_url"); work_Available_Object.options.length=0; var org_param=work_org_Object.value; var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking"; url +="&ORG=" + work_org_Object.value ; url +="&SEC=" + work_sec_Object.value ; url +="&SS=" + work_ss_Object.value ; url +="&U=" + work_u_Object.value ; url +="&SU=" + work_su_Object.value ; url +="&SSU=" + work_ssu_Object.value ; url +="&USERID=" + work_user_Object.value ; url_Object.value=url; // Open a connection to the server xmlHttp.open("GET", url, true); // Setup a function for the server to run when it's done xmlHttp.onreadystatechange = updatePage_index; // Send the request xmlHttp.send(null); }
Posts: 13 | Location: Los Angeles, Ca | Registered: November 08, 2005
IP
Member quote:
1) IE or Firefox? 2) How many xmlHttp objects are you creating. 3) Are the boxes chained to populate only when a selection is made on the parent?
Your questions
1) IE or Firefox? IE
2) How many xmlHttp objects are you creating. max of 18
3) Are the boxes chained to populate only when a selection is made on the parent? yes
Posts: 13 | Location: Los Angeles, Ca | Registered: November 08, 2005
IP
Virtuoso A couple of things you should look into. Put an alert at the beginning of all your onchange functions, I suspect that your onchange events might be being triggered at the wrong times. You might want to change your events to onclick events ... I am assuming that these are dropdown boxes, and you want to force the user to select something before the next action is launched.
Also, I also assume that these are intended to run sequentially. If that is true, you could simplify you code to run the ajax call in sync mode, and reduce the number of events flying around. Also, you are only declaring a single instance of the xmlHttp object, so it would be safer to change to sync execution in the end. The following is a simple example of running in a sync mode:
///////////////////////////
function url_build_sec(report,list_box){
var work_Available_Object = document.getElementById("lb_work");
var work_org_Object = document.getElementById("eb_org");
work_Available_Object.options.length=0;
var url="/ibi_apps/WFServlet?IBIF_ex=" + report + "&IBIAPP_app=fiscal_tracking";
url +="&ORG=" + work_org_Object.value ;
xmlHttp.open("GET", url, false); // <== when changed to sync (false), you can process the XML answer set without having to wait for events.
xmlHttp.send(null):
var responseXML = xmlHttp.responseXML;
var trs = responseXML.getElementsByTagName("tr");
document.getElementById("lb_sect").options.length = 0;
(work_Available_Object.options[work_Available_Object.length++].text="ALL");
var i=0;
for (r = 0; r < trs.length; r++) {
var tds = trs[r].getElementsByTagName("td");
i++;
document.getElementById("lb_sect").options[i] = new Option(tds[1].firstChild.nodeValue, tds[0].firstChild.nodeValue);
}
}
Let me know if this helps.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004
IP
Please Wait. Your request is being processed...
Read-Only TopicCopyright © 1996-2020 Information Builders