123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>파일첨부샘플</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <list>
- <reportlist>
- <reportnm/>
- <reportid/>
- </reportlist>
- </list>
- </main>
- <send>
- <attach>
- <file/>
- </attach>
- <title/>
- <reportid/>
- </send>
- <init/>
- <hidden/>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-model-construct">
- <![CDATA[
- model.removeNodeset("/root/req/grid");
- ]]>
- </script>
- <submission id="TXTSS00201" ref="/root/send" method="form-data-post" mediatype="multipart/form-data" resultref="/root/main/list"/>
- <submission id="TRTSS00201" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" resultref="/root/main/list"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fInitialize();
- ]]>
- </script>
- <submission id="TXTSS00202" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" resultref="/root/main/list"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript">
- <![CDATA[
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- function fInitialize() {
- model.removeNodeset("/root/main/list/reportlist");
- model.removeNodeset("/root/send/attach");
- model.resetInstanceNode("/root/send");
- model.refresh();
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body>
- <caption id="caption2" class="tit_1" style="left:65px; top:20px; width:217px; height:13px; vertical-align:middle; ">upload Control 사용예제</caption>
- <caption id="caption1" style="left:5px; top:390px; width:74px; height:20px; vertical-align:middle; ">보고서 제목 :</caption>
- <line id="line8" class="line_1" style="x1:0px; y1:112px; x2:665px; y2:112px; "/>
- <caption id="caption20" class="tit_2" style="left:6px; top:97px; width:118px; height:14px; ">보고서 목록</caption>
- <group id="group4" scroll="auto" style="left:0px; top:13px; width:665px; height:27px; ">
- <line id="line32" class="line_6" style="x1:0px; y1:25px; x2:665px; y2:25px; "/>
- <button id="btn_init" class="btn4_letter3" style="left:595px; top:3px; width:68px; height:22px; ">
- <caption>초기화</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fInitialize();
- ]]>
- </script>
- </button>
- <button id="btn_delete" class="btn4_letter2" style="left:535px; top:3px; width:56px; height:22px; ">
- <caption>삭제</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var cur_row = grd_report.row;
- var rptid = model.getValue("/root/main/list/reportlist["+cur_row+"]/reportid");
- model.setValue("/root/send/reportid",rptid);
- submit("TXTSS00202");
- ]]>
- </script>
- </button>
- </group>
- <group id="group2" style="left:0px; top:54px; width:665px; height:35px; vertical-align:top; ">
- <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:665px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
- <line id="line13" style="x1:579px; y1:7px; x2:579px; y2:29px; border-color:#ffe4bb; border-left-style:solid; "/>
- <button id="btn_search" class="btn1_letter2" style="left:595px; top:7px; width:56px; height:22px; ">
- <caption>조회</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- //model.send("TRZSS00101");
- submit("TRTSS00201");
- ]]>
- </script>
- </button>
- </group>
- <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; "/>
- <datagrid id="grd_attach" nodeset="/root/send/attach" caption="파일경로^" colwidth="644" extendlastcol="scroll" mergecellsfixedrows="bycolrec" style="left:0px; top:415px; width:665px; height:150px; ">
- <col ref="file"/>
- </datagrid>
- <button id="btn_addfile" class="btn2_letter4" style="left:530px; top:390px; width:64px; height:19px; ">
- <caption>addfile</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var maxsize = upload1.attribute("filesize");
-
- files = window.fileDialog("open", "|", true);
- filelist = files.split("|");
- for(var i = 0 ; i < filelist.length ; i++ ) {
- grd_attach.addRow(false);
- grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
- if (!checkFileSize(upload1)){
- grd_attach.removeItem();
- messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
-
- }
- }
- ]]>
- </script>
- </button>
- <button id="btn_upload" class="btn5_letter4" style="left:600px; top:390px; width:64px; height:19px; ">
- <caption>upload</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if (submit("TXTSS00201")) {
- model.removeNodeset("/root/send/attach");
- model.resetInstanceNode("/root/send/title");
- model.refresh();
- }
- ]]>
- </script>
- </button>
- <input id="ipt_title" ref="/root/send/title" style="left:85px; top:390px; width:295px; height:19px; "/>
- <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; ">
- <col ref="reportnm"/>
- <col ref="reportid"/>
- <script type="javascript" ev:event="ondblclick">
- <![CDATA[
- if( grd_report.isCell(event.target) && grd_report.row >= grd_report.fixedRows ){
- var curRow = grd_report.row;
- open("SPTSS00301_파일다운로드팝업",0,0,0,"pop1","/root/main/list/reportlist["+curRow+"]","/root/send");
- }
- ]]>
- </script>
- </datagrid>
- </xhtml:body>
- </xhtml:html>
|