var timerChExtL var objChExtLId //input do ID var objChExtLNn //input do Nome var tagChExtLLs //tag para implementar a lista para seleção var urlChExtLEp //url to end point function DefChExtLId(objId, urlEp) { objChExtLId = objId objChExtLNn = objId.parentNode.parentNode.childNodes[2].childNodes[0] objChExtLLs = objId.parentNode.parentNode.childNodes[1] urlChExtLEp = urlEp } function TypeChExtLId(objId, urlEp) { DefChExtLId(objId, urlEp) clearInterval(timerChExtL) timerChExtL = setTimeout('RequestChExtLId()', 700) } function RequestChExtLId() { if (objChExtLId.value == '') return goCmdAjax(GetChExtLId, 'GET', '../../../' + urlChExtLEp + 'GetNome/?id=' + objChExtLId.value, null, null); } function GetChExtLId(ls) { if (ls[0]) objChExtLNn.value = ls[0]['Nome']; else objChExtLNn.value = ''; } function DefChExtLNn(objNn, urlEp) { objChExtLId = objNn.parentNode.parentNode.childNodes[0].childNodes[0] objChExtLNn = objNn objChExtLLs = objNn.parentNode.parentNode.childNodes[1] urlChExtLEp = urlEp } function TypeChExtLNn(objNn, urlEp) { DefChExtLNn(objNn, urlEp) clearInterval(timerChExtL) timerChExtL = setTimeout('RequestChExtLNn()', 700) } function RequestChExtLNn() { if (objChExtLNn.value == '') return goCmdAjax(GetChExtLNn, 'GET', '../../../' + urlChExtLEp + 'Find/?col=Nome&val=' + objChExtLNn.value, null, null); } function GetChExtLNn(ls) { let rc = new Array(); rc[rc.length] = ""; let DuoColor = false; for (l in ls) { rc[rc.length] = " "; DuoColor = !DuoColor; } rc[rc.length] = "
"; //debugger; objChExtLLs.innerHTML = rc.join(""); } function FillChExtLNn(id, nn) { objChExtLId.value = id if (objChExtLId.onchange) { objChExtLId.onchange() } objChExtLNn.value = nn objChExtLLs.innerHTML = '' }