SMTSS00201_파일첨부샘플.xrw 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>파일첨부샘플</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <list>
  11. <reportlist>
  12. <reportnm/>
  13. <reportid/>
  14. </reportlist>
  15. </list>
  16. </main>
  17. <send>
  18. <attach>
  19. <file/>
  20. </attach>
  21. <title/>
  22. <reportid/>
  23. </send>
  24. <init/>
  25. <hidden/>
  26. </root>
  27. </instance>
  28. <script type="javascript" ev:event="xforms-model-construct">
  29. <![CDATA[
  30. model.removeNodeset("/root/req/grid");
  31. ]]>
  32. </script>
  33. <submission id="TXTSS00201" ref="/root/send" method="form-data-post" mediatype="multipart/form-data" resultref="/root/main/list"/>
  34. <submission id="TRTSS00201" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" resultref="/root/main/list"/>
  35. <script type="javascript" ev:event="xforms-ready">
  36. <![CDATA[
  37. fInitialize();
  38. ]]>
  39. </script>
  40. <submission id="TXTSS00202" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" resultref="/root/main/list"/>
  41. </model>
  42. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  43. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  44. <script type="javascript">
  45. <![CDATA[
  46. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  47. function fInitialize() {
  48. model.removeNodeset("/root/main/list/reportlist");
  49. model.removeNodeset("/root/send/attach");
  50. model.resetInstanceNode("/root/send");
  51. model.refresh();
  52. }
  53. ]]>
  54. </script>
  55. </xhtml:head>
  56. <xhtml:body>
  57. <caption id="caption2" class="tit_1" style="left:65px; top:20px; width:217px; height:13px; vertical-align:middle; ">upload Control 사용예제</caption>
  58. <caption id="caption1" style="left:5px; top:390px; width:74px; height:20px; vertical-align:middle; ">보고서 제목 :</caption>
  59. <line id="line8" class="line_1" style="x1:0px; y1:112px; x2:665px; y2:112px; "/>
  60. <caption id="caption20" class="tit_2" style="left:6px; top:97px; width:118px; height:14px; ">보고서 목록</caption>
  61. <group id="group4" scroll="auto" style="left:0px; top:13px; width:665px; height:27px; ">
  62. <line id="line32" class="line_6" style="x1:0px; y1:25px; x2:665px; y2:25px; "/>
  63. <button id="btn_init" class="btn4_letter3" style="left:595px; top:3px; width:68px; height:22px; ">
  64. <caption>초기화</caption>
  65. <script type="javascript" ev:event="DOMActivate">
  66. <![CDATA[
  67. fInitialize();
  68. ]]>
  69. </script>
  70. </button>
  71. <button id="btn_delete" class="btn4_letter2" style="left:535px; top:3px; width:56px; height:22px; ">
  72. <caption>삭제</caption>
  73. <script type="javascript" ev:event="DOMActivate">
  74. <![CDATA[
  75. var cur_row = grd_report.row;
  76. var rptid = model.getValue("/root/main/list/reportlist["+cur_row+"]/reportid");
  77. model.setValue("/root/send/reportid",rptid);
  78. submit("TXTSS00202");
  79. ]]>
  80. </script>
  81. </button>
  82. </group>
  83. <group id="group2" style="left:0px; top:54px; width:665px; height:35px; vertical-align:top; ">
  84. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:665px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  85. <line id="line13" style="x1:579px; y1:7px; x2:579px; y2:29px; border-color:#ffe4bb; border-left-style:solid; "/>
  86. <button id="btn_search" class="btn1_letter2" style="left:595px; top:7px; width:56px; height:22px; ">
  87. <caption>조회</caption>
  88. <script type="javascript" ev:event="DOMActivate">
  89. <![CDATA[
  90. //model.send("TRZSS00101");
  91. submit("TRTSS00201");
  92. ]]>
  93. </script>
  94. </button>
  95. </group>
  96. <upload id="upload1" nodeset="/root/send/attach/file" validate="true" filesize="1048576" filecount="5" ext="zip" style="left:410px; top:390px; width:100px; height:20px; "/>
  97. <datagrid id="grd_attach" nodeset="/root/send/attach" caption="파일경로^" colwidth="644" extendlastcol="scroll" mergecellsfixedrows="bycolrec" style="left:0px; top:415px; width:665px; height:150px; ">
  98. <col ref="file"/>
  99. </datagrid>
  100. <button id="btn_addfile" class="btn2_letter4" style="left:530px; top:390px; width:64px; height:19px; ">
  101. <caption>addfile</caption>
  102. <script type="javascript" ev:event="DOMActivate">
  103. <![CDATA[
  104. var maxsize = upload1.attribute("filesize");
  105. files = window.fileDialog("open", "|", true);
  106. filelist = files.split("|");
  107. for(var i = 0 ; i < filelist.length ; i++ ) {
  108. grd_attach.addRow(false);
  109. grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
  110. if (!checkFileSize(upload1)){
  111. grd_attach.removeItem();
  112. messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
  113. }
  114. }
  115. ]]>
  116. </script>
  117. </button>
  118. <button id="btn_upload" class="btn5_letter4" style="left:600px; top:390px; width:64px; height:19px; ">
  119. <caption>upload</caption>
  120. <script type="javascript" ev:event="DOMActivate">
  121. <![CDATA[
  122. if (submit("TXTSS00201")) {
  123. model.removeNodeset("/root/send/attach");
  124. model.resetInstanceNode("/root/send/title");
  125. model.refresh();
  126. }
  127. ]]>
  128. </script>
  129. </button>
  130. <input id="ipt_title" ref="/root/send/title" style="left:85px; top:390px; width:295px; height:19px; "/>
  131. <datagrid id="grd_report" nodeset="/root/main/list/reportlist" caption="제목^보고서 ID^" colwidth="474, 170" extendlastcol="scroll" mergecellsfixedrows="bycolrec" style="left:0px; top:117px; width:665px; height:255px; ">
  132. <col ref="reportnm"/>
  133. <col ref="reportid"/>
  134. <script type="javascript" ev:event="ondblclick">
  135. <![CDATA[
  136. if( grd_report.isCell(event.target) && grd_report.row >= grd_report.fixedRows ){
  137. var curRow = grd_report.row;
  138. open("SPTSS00301_파일다운로드팝업",0,0,0,"pop1","/root/main/list/reportlist["+curRow+"]","/root/send");
  139. }
  140. ]]>
  141. </script>
  142. </datagrid>
  143. </xhtml:body>
  144. </xhtml:html>