var preFilter = new Array(10); var initFilter= new Array(10); var disabledFilter = new Array(10); var indexInitFilter = 0; var indexPreFilter = 0; var indexDisabledFilter = 0; var destField; var bAppendData = false; var bSelectMultiple = false; var bPreserveCase = false; var bCallBack = false; var iWidth = 700; var iHeight = 600; function callBackLovField() { return (destField); } function setSearchFilterFromChoice(filterField) { obj = eval (document.forms[0][filterField]); setInitFilterData(obj[obj.selectedIndex].value); } function setSearchFilter(filterField) { obj = eval (document.forms[0][filterField]); setInitFilterData(obj.value); } function setInitFilterData(filterData) { initFilter[indexInitFilter++] = filterData; } function setBindSqlParmFromChoice(filterField) { obj = eval (document.forms[0][filterField]); setPreFilterData(obj[obj.selectedIndex].value); } function setBindSqlParm(filterField) { obj = eval (document.forms[0][filterField]); setPreFilterData(obj.value); } function setPreFilterData(filterData) { preFilter[indexPreFilter++] = filterData; } function setDisabledFilter(filterNumber) { disabledFilter[indexDisabledFilter++] = filterNumber; } function appendData() { bAppendData = true; } function selectMultiple() { bSelectMultiple = true; } function preserveCase() { bPreserveCase = true; } function useCallBack() { bCallBack = true; } function setWindowSize(width, height) { iWidth = width; iHeight = height; } function startLov(targetFieldName, lovID) { startLov(targetFieldName, lovID, ''); } function focusObject(targetFieldName){ obj = document.forms[0][targetFieldName]; obj.focus(); } function startLov(targetFieldName, lovID, misc) { obj = eval (document.forms[0][targetFieldName]); if (obj.disabled) { bAppendData = false; bSelectMultiple = false; indexInitFilter = 0; indexPreFilter = 0; return false; } sURL = ""+window.location; sURL = (sURL.indexOf("/em/console/database") > 0) ? "/em" : ""; sURL += "/console/database/lov?target="+queryString('target'); sURL +="&type="+queryString('type'); sURL +="×tamp="+ (new Date()).getTime(); sURL +="&lovID="+lovID+ "&targetFieldName="+targetFieldName; sURL +="&_em.coIFR=true&no_frame=/faces/sdk/nonFacesWrapper"; if (bAppendData) { sURL += "&appendData=1"; bAppendData = false; } if (bSelectMultiple) { sURL += "&selectMultiple=1"; bSelectMultiple = false; } if (bPreserveCase) { sURL += "&preserveCase=1"; bPreserveCase = false; } if (bCallBack) { sURL += "&callBack=1"; bCallBack = false; } if (indexInitFilter > 0) { s = ""; for (i=0; i < indexInitFilter; i++) s += "&filter"+i+"="+ encodeURIComponent(initFilter[i]); sURL += s; indexInitFilter = 0; } if (indexPreFilter > 0) { s = ""; for (i=0; i < indexPreFilter; i++) s += "&preFilter"+i+"="+ encodeURIComponent(preFilter[i]); sURL += s; indexPreFilter = 0; } if (indexDisabledFilter > 0) { s = ""; for (i=0; i < indexDisabledFilter; i++) s += "&disabledFilter"+i+"="+disabledFilter[i]; sURL += s; indexDisabledFilter = 0; } if ((misc != null) && (misc.length > 0)) sURL += "&"+misc; destField = targetFieldName; openWindow(window, sURL, 'emlovWindow', {width:iWidth, height:iHeight}, true, 'dialog', callBackLovField); } function queryString(key) { sUrl = location.search.substring(1); i = sUrl.indexOf(key+"="); while ( i >= 0 ) { if((i > 0) && (sUrl.substring(i-1, i) != "&")) { sUrl = sUrl.substring( key.length+i+1 ); i = sUrl.indexOf(key+"="); continue; } sUrl = sUrl.substring( key.length+i+1 ); i = sUrl.indexOf("&"); return(sUrl.substring( 0, (i>=0) ? i : sUrl.length )); } return(""); }