RAC001.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /***************************************************************************************************************
  2. *
  3. * racfGetCashAcntCd 현금계정코드를 반환한다.
  4. *
  5. * racfAcntValidCheck 계정코드 엔터 및 값변경시 조회 함수
  6. * racfDeptValidCheck 부서코드 엔터 및 값변경시 조회 함수
  7. * racfNoteValidCheck 기재사항 엔터 및 값변경시 조회 함수
  8. * racfCustValidCheck 사업번호 엔터 및 값변경시 조회 함수 ex)
  9. * - 리턴값 : 사업자등록번호, 거래처명, 대표자명, 전화번호, 주소, 업태, 종목, 시작일자, 종료일자.
  10. * - 사용예 :
  11. * 1. 사업자 등록번호, 거래처명만 가져오고 싶을경우
  12. * racfCustValidCheck("사업자등록번호 노드명,거래처명 노드명");
  13. *
  14. * 2. 사업자 등록번호, 거래처명, 주소를 가져오고 싶을경우
  15. * (이경우는 대표자명과, 전화번호를 넘어가야하기 때문에 뿌려질 노드의 같은경로에 임의의 노드를 만들어 준다.
  16. * 만일 임의의 노드가 temp1, temp2 일경우라고 가정한 예)
  17. * racfCustValidCheck("사업자등록번호 노드명,거래처명 노드명,temp1,temp2,주소");
  18. *
  19. * racfAactValidCheck 계좌번호 엔터 및 값변경시 조회 함수
  20. *
  21. * racfValidCheck 몇몇 코드들에 대한 코드 or 값을 조회한다.
  22. *
  23. * racfGetCadlYmd 기수 관리 테이블에 있는 회계년도를 조회한다.
  24. *
  25. * racfGetSupAcntPrAcntListCombo SupAcntCd4 별로 AcntCd List를 조회한다.
  26. *
  27. *
  28. *
  29. *
  30. *
  31. *
  32. *
  33. *
  34. ***************************************************************************************************************/
  35. var cashacntcd = "1110101";
  36. function racfGetCashAcntCd()
  37. {
  38. return cashacntcd;
  39. }
  40. // 계정코드 및 계정명시 조회 함수
  41. /*
  42. * recvlist : 저장될 인스턴스 경로;
  43. */
  44. function racfAcntValidCheck(recvlist, pKind)
  45. {
  46. if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
  47. {
  48. if(event.name == "onkeypress")
  49. {
  50. if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
  51. }
  52. document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
  53. }
  54. racfValidCheck("05", "", recvlist, null, null, pKind);
  55. model.refresh();
  56. }
  57. // 예산코드 조회 함수
  58. /*
  59. * recvlist : 저장될 인스턴스 경로;
  60. */
  61. function racfBugtAcntValidCheck(recvlist, pKind)
  62. {
  63. if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
  64. {
  65. if(event.name == "onkeypress")
  66. {
  67. if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
  68. }
  69. document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
  70. }
  71. racfValidCheck("10", "", recvlist, null, null, pKind);
  72. model.refresh();
  73. }
  74. // 부서코드 및 부서명 입력시 조회 함수
  75. /*
  76. * recvlist : 저장될 인스턴스 경로;
  77. */
  78. function racfDeptValidCheck(recvlist, pKind)
  79. {
  80. if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
  81. {
  82. if(event.name == "onkeypress")
  83. {
  84. if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
  85. }
  86. document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
  87. }
  88. racfValidCheck("02", "", recvlist, null, null, pKind);
  89. model.refresh();
  90. }
  91. // 예산 부서코드 및 예산 부서명 입력시 조회 함수
  92. /*
  93. * recvlist : 저장될 인스턴스 경로;
  94. */
  95. function racfBugtDeptValidCheck(recvlist, pKind)
  96. {
  97. if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
  98. {
  99. if(event.name == "onkeypress")
  100. {
  101. if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
  102. }
  103. document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
  104. }
  105. racfValidCheck("11", "", recvlist, null, null, pKind);
  106. model.refresh();
  107. }
  108. // 기재사항코드 및 기재사항명값 입력시 조회 함수
  109. /*
  110. * recvlist : 저장될 인스턴스 경로;
  111. */
  112. function racfNoteValidCheck(recvlist, pKind)
  113. {
  114. if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
  115. {
  116. if(event.name == "onkeypress")
  117. {
  118. if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
  119. }
  120. document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
  121. }
  122. racfValidCheck("06", "", recvlist, null, null, pKind);
  123. model.refresh();
  124. }
  125. // 거래처코드 및 거래처명 입력시 조회 함수
  126. /*
  127. * recvlist : 저장될 인스턴스 경로;
  128. */
  129. function racfCustValidCheck(recvlist, pKind)
  130. {
  131. if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
  132. {
  133. if(event.name == "onkeypress")
  134. {
  135. if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
  136. }
  137. document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText.replace("-", "").replace("-", "");
  138. }
  139. racfValidCheck("14", "", recvlist, null, null, pKind);
  140. model.refresh();
  141. }
  142. // 계좌코드 및 계좌번호 입력시 조회 함수
  143. /*
  144. * recvlist : 저장될 인스턴스 경로;
  145. */
  146. function racfAactValidCheck(recvlist, pKind)
  147. {
  148. if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
  149. {
  150. if(event.name == "onkeypress")
  151. {
  152. if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
  153. }
  154. document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
  155. }
  156. racfValidCheck("15", "", recvlist, null, null, pKind);
  157. model.refresh();
  158. }
  159. // 기수 관리 테이블에 있는 회계년도를 조회한다.
  160. /*
  161. * pInstacePath : 데이터 노드경로
  162. * pRecvList : 저장될 인스턴스 경로;
  163. */
  164. function racfGetCadlYmd(pInstacePath, pRecvList)
  165. {
  166. var sRecvNode = "cadldd";
  167. var sParamsNode = "/root/send";
  168. var sRsltNode = "/root/rslt";
  169. model.removeNodeset(sRsltNode);
  170. model.makeNode(sRsltNode);
  171. model.removeNodeset(pRecvList);
  172. model.makeNode(pRecvList);
  173. var sRsltNodePath = "";
  174. var arrRsltNodes = pRecvList.split('/');
  175. for(var i=1; i<arrRsltNodes.length -1; i++)
  176. {
  177. sRsltNodePath = sRsltNodePath + "/" + arrRsltNodes[i];
  178. }
  179. model.removeChild("TRRAC90205");
  180. model.createChild("xforms:submission", "id:TRRAC90205;mediatype:application/x-www-form-urlencoded; method:post; ref:" + sParamsNode + "; resultref:" + sRsltNode + "; ");
  181. submit("TRRAC90205");
  182. var rslt_node = new Array();
  183. var node = instance1.selectNodes(sRsltNode + "/*");
  184. for (var j = 0; j < node.length; j++)
  185. {
  186. model.makeValue(pRecvList + "/" + node.item(j).nodeName, model. getValue(sRsltNode + "/" + node.item(j).nodeName));
  187. }
  188. }
  189. //코드 Validation Check한다.
  190. /*
  191. pvali_kind : Validation 종류(부서코드, 공통코드, 우편번호...)
  192. "01" - 사번조회
  193. "02" - 부서코드
  194. "03" - 공통코드
  195. "04" - 우편번호
  196. "05" - 계정코드
  197. "09" - 근무코드
  198. precv_list : 자료를 받을 Instance Node(콤마로 분류해서 넘기면됨)
  199. */
  200. function racfValidCheck(pvali_kind, pcdgrupid, precv_list, pValueControl, pNodeNames, pKind)
  201. {
  202. var objID = event.currentTarget;
  203. var obj = document.controls(objID);
  204. var arrCtrlNames = null;
  205. var arrNodeNames = null;
  206. if(obj != null && obj.elementName == "xforms:group")
  207. {
  208. objID = event.Target;
  209. obj = document.controls(objID);
  210. }
  211. if(pValueControl != null && pValueControl != "")
  212. {
  213. arrCtrlNames = pValueControl.split(",");
  214. }
  215. if(pNodeNames != null && pValueControl != "")
  216. {
  217. arrNodeNames = pValueControl.split(",");
  218. }
  219. var vali_kind = pvali_kind.substr(0,2);
  220. var validation_node = "/root/send/validation";
  221. var validation_rsltnode = "/root/init/validation";
  222. var recv_node = precv_list.split(",");
  223. model.removeNodeset(validation_node);
  224. model.removeNodeset(validation_rsltnode);
  225. model.makeNode(validation_node);
  226. model.makeValue(validation_node + "/cdgrupid", pcdgrupid);
  227. model.makeNode(validation_rsltnode);
  228. var result_path = "";
  229. if (obj.elementName == "xforms:datagrid")
  230. {
  231. result_path = obj.nodeset;
  232. model.makeValue(validation_node + "/getcond", model.getValue(result_path + "[" + (obj.row - obj.fixedRows + 1) + "]/" + obj.colAttribute(obj.col,"ref")));
  233. model.makeValue(validation_node + "/retrkind", pKind);
  234. }
  235. else
  236. {
  237. var node_path = obj.attribute("ref").split("/");
  238. result_path = "/root";
  239. for (var i = 2 ; i < node_path.length - 1; i++)
  240. {
  241. result_path = result_path + "/" + node_path[i];
  242. }
  243. model.makeValue(validation_node + "/getcond", model.getValue(obj.attribute("ref")));
  244. model.makeValue(validation_node + "/retrkind", pKind);
  245. }
  246. if(model.getValue(validation_node + "/getcond") == null || model.getValue(validation_node + "/getcond") == "") {
  247. for (var i = 0; i < recv_node.length; i++) {
  248. if (obj.elementName == "xforms:datagrid") {
  249. model.setValue(result_path + "[" + (obj.row - obj.fixedRows + 1) + "]/" + recv_node[i], "");
  250. }
  251. else {
  252. model.setValue(result_path + "/" + recv_node[i], "");
  253. }
  254. }
  255. return;
  256. }
  257. if(pvali_kind == "02") { //부서코드
  258. model.removeChild("TRRPZ00202");
  259. model.createChild("xforms:submission", "id:TRRPZ00202;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  260. submit("TRRPZ00202");
  261. var rslt_node = new Array();
  262. var node = instance1.selectNodes(validation_rsltnode + "/deptcodelist" + "/*");
  263. for (var j = 0; j < node.length; j++) {
  264. if (obj.elementName == "xforms:datagrid") {
  265. rslt_node[j] = model.getValue(validation_rsltnode + "/deptcodelist" + "[1]/" + node.item(j).nodeName);
  266. }
  267. else {
  268. rslt_node[j] = model.getValue(validation_rsltnode + "/deptcodelist" + "/" + node.item(j).nodeName);
  269. }
  270. }
  271. }
  272. else if(pvali_kind == "03") { //공통코드
  273. model.removeChild("TRRPZ00303");
  274. model.createChild("xforms:submission", "id:TRRPZ00303;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  275. submit("TRRPZ00303");
  276. var rslt_node = new Array();
  277. var node = instance1.selectNodes(validation_rsltnode + "/comcodelist" + "/*");
  278. for (var j = 0; j < node.length; j++) {
  279. if (obj.elementName == "xforms:datagrid") {
  280. rslt_node[j] = model.getValue(validation_rsltnode + "/comcodelist" + "[1]/" + node.item(j).nodeName);
  281. }
  282. else {
  283. rslt_node[j] = model.getValue(validation_rsltnode + "/comcodelist" + "/" + node.item(j).nodeName);
  284. }
  285. }
  286. }
  287. else if(pvali_kind == "05") //계정코드
  288. {
  289. model.removeChild("TRRAC90105");
  290. model.createChild("xforms:submission", "id:TRRAC90105;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  291. submit("TRRAC90105");
  292. var rslt_node = new Array();
  293. var node = instance1.selectNodes(validation_rsltnode + "/acntlist" + "/*");
  294. for (var j = 0; j < node.length; j++)
  295. {
  296. if (obj.elementName == "xforms:datagrid")
  297. {
  298. rslt_node[j] = model.getValue(validation_rsltnode + "/acntlist" + "[1]/" + node.item(j).nodeName);
  299. }
  300. else
  301. {
  302. rslt_node[j] = model.getValue(validation_rsltnode + "/acntlist" + "/" + node.item(j).nodeName);
  303. }
  304. }
  305. }
  306. else if(pvali_kind == "06") //기재사항코드
  307. {
  308. model.removeChild("TRRAC90305");
  309. model.createChild("xforms:submission", "id:TRRAC90305;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  310. submit("TRRAC90305");
  311. var rslt_node = new Array();
  312. var node = instance1.selectNodes(validation_rsltnode + "/notelist" + "/*");
  313. for (var j = 0; j < node.length; j++)
  314. {
  315. if (obj.elementName == "xforms:datagrid")
  316. {
  317. rslt_node[j] = model.getValue(validation_rsltnode + "/notelist" + "[1]/" + node.item(j).nodeName);
  318. }
  319. else
  320. {
  321. rslt_node[j] = model.getValue(validation_rsltnode + "/notelist" + "/" + node.item(j).nodeName);
  322. }
  323. }
  324. }
  325. else if(pvali_kind == "10") //예산코드
  326. {
  327. model.removeChild("TRRAC90805");
  328. model.createChild("xforms:submission", "id:TRRAC90805;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  329. submit("TRRAC90805");
  330. var rslt_node = new Array();
  331. var node = instance1.selectNodes(validation_rsltnode + "/acntcodelist" + "/*");
  332. for (var j = 0; j < node.length; j++)
  333. {
  334. if (obj.elementName == "xforms:datagrid")
  335. {
  336. rslt_node[j] = model.getValue(validation_rsltnode + "/acntcodelist" + "[1]/" + node.item(j).nodeName);
  337. }
  338. else
  339. {
  340. rslt_node[j] = model.getValue(validation_rsltnode + "/acntcodelist" + "/" + node.item(j).nodeName);
  341. }
  342. }
  343. }
  344. else if(pvali_kind == "14") // 거래처
  345. {
  346. model.removeChild("TRRAC90605");
  347. model.createChild("xforms:submission", "id:TRRAC90605;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  348. submit("TRRAC90605");
  349. var rslt_node = new Array();
  350. var node = instance1.selectNodes(validation_rsltnode + "/custlist" + "/*");
  351. for (var j = 0; j < node.length; j++)
  352. {
  353. if (obj.elementName == "xforms:datagrid")
  354. {
  355. rslt_node[j] = model.getValue(validation_rsltnode + "/custlist" + "[1]/" + node.item(j).nodeName);
  356. }
  357. else
  358. {
  359. rslt_node[j] = model.getValue(validation_rsltnode + "/custlist" + "/" + node.item(j).nodeName);
  360. }
  361. }
  362. }
  363. else if (pvali_kind == "15") // 계좌번호
  364. {
  365. var oCtrl
  366. if(arrCtrlNames != null && arrNodeNames != null)
  367. {
  368. for(var i=0; i<arrCtrlNames.length; i++)
  369. {
  370. oCtrl = document.controls(arrCtrlNames[i]);
  371. model.makeValue(validation_node + "/" + arrNodeNames[i], model.getValue(oCtrl.attribute("ref")));
  372. }
  373. }
  374. model.removeChild("TRRAC90405");
  375. model.createChild("xforms:submission", "id:TRRAC90405;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  376. submit("TRRAC90405");
  377. var rslt_node = new Array();
  378. var node = instance1.selectNodes(validation_rsltnode + "/aactlist" + "/*");
  379. for (var j = 0; j < node.length; j++)
  380. {
  381. if (obj.elementName == "xforms:datagrid")
  382. {
  383. rslt_node[j] = model.getValue(validation_rsltnode + "/aactlist" + "[1]/" + node.item(j).nodeName);
  384. }
  385. else
  386. {
  387. rslt_node[j] = model.getValue(validation_rsltnode + "/aactlist" + "/" + node.item(j).nodeName);
  388. }
  389. }
  390. }
  391. else if(pvali_kind == "11") // 예산 부서 코드
  392. {
  393. model.removeChild("TRRAC90705");
  394. model.createChild("xforms:submission", "id:TRRAC90705;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
  395. submit("TRRAC90705");
  396. var rslt_node = new Array();
  397. var node = instance1.selectNodes(validation_rsltnode + "/bugtdeptlist" + "/*");
  398. //alert(node.length);
  399. for (var j = 0; j < node.length; j++)
  400. {
  401. if (obj.elementName == "xforms:datagrid")
  402. {
  403. rslt_node[j] = model.getValue(validation_rsltnode + "/bugtdeptlist" + "[1]/" + node.item(j).nodeName);
  404. }
  405. else
  406. {
  407. rslt_node[j] = model.getValue(validation_rsltnode + "/bugtdeptlist" + "/" + node.item(j).nodeName);
  408. }
  409. }
  410. }
  411. var node1 = instance1.selectNodes(validation_rsltnode + "/*");
  412. //alert(node1.length);
  413. if (node1.length != 1)
  414. {
  415. model.removeNodeset("/root/source/validation");
  416. model.makeNode("/root/source/validation")
  417. model.copyNode("/root/source/validation", validation_rsltnode);
  418. misfOpenPopUpList(vali_kind, obj, "", precv_list, pValueControl, pNodeNames)
  419. }
  420. else
  421. {
  422. for (var i = 0; i < recv_node.length; i++)
  423. {
  424. if (obj.elementName == "xforms:datagrid")
  425. {
  426. model.setValue(result_path + "[" + (obj.row - obj.fixedRows + 1) + "]/" + recv_node[i], rslt_node[i]);
  427. }
  428. else
  429. {
  430. model.setValue(result_path + "/" + recv_node[i], rslt_node[i]);
  431. }
  432. }
  433. }
  434. }
  435. // 상위계정코드4 단위의 계정코드 조회 콤보
  436. function racfGetSupAcntPrAcntListCombo(pParamValue, pControl, pall)
  437. {
  438. var control_id = pControl.attribute("id");
  439. var sParamsNode = "/root/send/paramref";
  440. var sRsltNode = "/root/init/acnt";
  441. var sItemSet = "/root/init/" + control_id;
  442. model.removeNodeset(sParamsNode);
  443. model.removeNodeset(sItemSet);
  444. model.makeNode(sParamsNode);
  445. model.makeNode(sRsltNode);
  446. model.makeNode(sItemSet);
  447. model.makeValue(sParamsNode + "/supacntcd4", pParamValue);
  448. pControl.choices.itemset.attribute("nodeset") = sItemSet + "/acntlist";
  449. pControl.choices.itemset.value.attribute("ref") = "acntcd";
  450. pControl.choices.itemset.label.attribute("ref") = "acntnm";
  451. pControl.refresh();
  452. model.removeChild("TRRAD00809");
  453. model.createChild("xforms:submission", "id:TRRAD00809;mediatype:application/x-www-form-urlencoded; method:post; ref:" + sParamsNode + "; resultref:" + sRsltNode + "; ");
  454. submit("TRRAD00809");
  455. if(pall != null && pall == "Y")
  456. {
  457. model.makeValue(sItemSet + "/acntlist[" + 1 + "]/acntcd", "");
  458. model.makeValue(sItemSet + "/acntlist[" + 1 + "]/acntnm", "");
  459. sourcenode = document.models(0).instances(0).selectSingleNode(sRsltNode);
  460. tarnode = document.models(0).instances(0).selectSingleNode(sItemSet);
  461. cnt = 1;
  462. var sourcenodelist = sourcenode.childNodes;
  463. while (childNode = sourcenodelist.nextNode())
  464. {
  465. model.makeValue(sItemSet + "/acntlist[" + (cnt + 1) + "]/acntcd", childNode.getXPathString(sRsltNode + "/acntlist[" + cnt + "]/acntcd"));
  466. model.makeValue(sItemSet + "/acntlist[" + (cnt + 1) + "]/acntnm", childNode.getXPathString(sRsltNode + "/acntlist[" + cnt + "]/acntnm"));
  467. cnt++;
  468. }
  469. }
  470. else
  471. {
  472. model.copyNode(sItemSet, sRsltNode);
  473. }
  474. model.refresh();
  475. }
  476. // 상위계정코드4 단위의 계정코드 조회 콤보
  477. function racfAcntMngtListCombo(pParamValue, pInstCd, pControl, pall)
  478. {
  479. var control_id = pControl.attribute("id");
  480. var sParamsNode = "/root/send/paramref";
  481. var sRsltNode = "/root/init/code";
  482. var sItemSet = "/root/init/" + control_id;
  483. model.removeNodeset(sParamsNode);
  484. model.removeNodeset(sItemSet);
  485. model.makeNode(sParamsNode);
  486. model.makeNode(sRsltNode);
  487. model.makeNode(sItemSet);
  488. // ParamaterValue Setting
  489. model.makeValue(sParamsNode + "/mngtcd", pParamValue);
  490. if(pInstCd == null && pInstCd == "")
  491. {
  492. model.makeValue(sParamsNode + "/instcd", "");
  493. }
  494. else
  495. {
  496. model.makeValue(sParamsNode + "/instcd", pInstCd);
  497. }
  498. pControl.choices.itemset.attribute("nodeset") = sItemSet + "/codelist";
  499. pControl.choices.itemset.value.attribute("ref") = "cdid";
  500. pControl.choices.itemset.label.attribute("ref") = "cdnm";
  501. pControl.refresh();
  502. model.removeChild("TRRAZ00001");
  503. model.createChild("xforms:submission", "id:TRRAZ00001;mediatype:application/x-www-form-urlencoded; method:post; ref:" + sParamsNode + "; resultref:" + sRsltNode + "; ");
  504. submit("TRRAZ00001");
  505. if(pall != null && pall == "Y")
  506. {
  507. model.makeValue(sItemSet + "/codelist[" + 1 + "]/cdid", "");
  508. model.makeValue(sItemSet + "/codelist[" + 1 + "]/cdnm", "");
  509. sourcenode = document.models(0).instances(0).selectSingleNode(sRsltNode);
  510. tarnode = document.models(0).instances(0).selectSingleNode(sItemSet);
  511. cnt = 1;
  512. var sourcenodelist = sourcenode.childNodes;
  513. while (childNode = sourcenodelist.nextNode())
  514. {
  515. model.makeValue(sItemSet + "/codelist[" + (cnt + 1) + "]/cdid", childNode.getXPathString(sRsltNode + "/codelist[" + cnt + "]/cdid"));
  516. model.makeValue(sItemSet + "/codelist[" + (cnt + 1) + "]/cdnm", childNode.getXPathString(sRsltNode + "/codelist[" + cnt + "]/cdnm"));
  517. cnt++;
  518. }
  519. }
  520. else
  521. {
  522. model.copyNode(sItemSet, sRsltNode);
  523. }
  524. model.refresh();
  525. }