게시판을 이용해 주셔서 감사합니다.
다음양식에 맞게 입력해주세요.
* 고객시스템명 : 엘지전자 창원 1공장
* GAUCE 버전 :
* WAS 종류(WebLogic 등등) : weblogic 8.1
* DB 종류 : Oracle 10g
* 문의 유형(질문/요청/참조) : 요청
* 내용 :
유선상으로 문의드렸는데요..
그리드에서 파일다운로드 기능을 구현하려고 합니다.
그리드에서 데이터만 나오게 하는 소스까지 구현했습니다.
+---------------------------------+
| subject | File | Date |
+-----------+--------+------------+
| test | 이미지 | 2010-06-15 |
+-----------+--------+------------+
예를들면 이런식으로 그리드가 나오고 File 필드엔 디스켓 이미지가 나오고 그 이미지를 클릭했을시 해당경로에 있는 파일이 다운로드 되게 구현을 하고싶습니다.
아래 소스중
+ '<C>id=issueFile name="File" width=100 align=center '+ editable + '</C>'
이 부분이 이미지가 나올부분이고 파일경로도 db 에서 읽어옵니다.
감사합니다.
<html>
<head>
<title>Daily Issue Open</title>
<%@include file="/sys/include/head.jsp"%>
<%@include file="/sys/include/getSession.jsp"%>
<%@include file="/sys/include/uiLog.jsp"%>
<script language='javascript'>
/* 화면 로딩시*/
function f_OnLoad() {
//grid를 생성
gridCreate();
//해상도에 따라 height 결정
(new JsObject(GD_MASTER)).autoHeight();
initProgressBar();
//초기화
ds_bu.clearAll();
//콤보 조회
f_buCombo();
}
// BU 콤보 가져오기
function f_buCombo() {
var uri = new JsURI();
uri.SetPage("<%= contextPath %>/COM.COMBO.CommonCombo.gau");
uri.Add("cmd","retrieveBuCombo");
uri.Add("coCompany","<%=_S_COMPANY%>");
ds_bu.DataID = uri.GetURI();
ds_bu.Reset();
}
/* 버튼 이벤트 */
// btn_Search
function btn_Search() {
var uri = new JsURI();
uri.SetPage("<%= contextPath %>/DI.OP.RetrieveDailyIssueOpen.gau");
uri.Add("cmd","retrieveDailyIssueOpen");
uri.Add("coBu",$F('co_bu'));
uri.Add("coStatus","O");
uri.Add("coCompany","<%=_S_COMPANY%>");
ds_master.DataID = uri.GetURI();
ds_master.Reset();
}
// btn_ExcelDown
function btn_ExcelDown(){
openExcel(GD_MASTER, "Master Info.");
}
// btn_add
function btn_Add(){
var date = new Date();
var year = String(date.getFullYear());
var v_division = "<%=_S_DIVISION%>";
ds_master.AddRow();
if (v_division!="Empty"){
ds_master.namevalue(ds_master.RowPosition, "bu") = v_division;
}
ds_master.namevalue(ds_master.RowPosition, "regYear") = year;
ds_master.namevalue(ds_master.RowPosition, "enabledFlag") = "Y";
}
// btn_del
function btn_Delete(){
var row_num = ds_master.RowPosition;
var row_value = "";
var del_YN = "Y";
for(var i=2; i<=3; i++){
row_value = ds_master.ColumnValue(row_num,i);
if (row_value!=""){
cfAlertMsg(TLP_COM_ERR_070, [row_num]);
del_YN ="N";
return;
}
}
if (del_YN=="Y"){
ds_master.DeleteRow(ds_master.RowPosition);
}else{
return;
}
}
//-------------------------------------------------------------------------
// 필수여부 체크
//-------------------------------------------------------------------------
// 김성도 수정 2010-05-03
function f_Check() {
var row_value = "";
var row_mst_value = ""; // 기준이 되는 값
var row_mst_value_ = ""; // 비교되는 값
var row_mst_flag = "Y";
for(var i=1; i<=ds_master.CountRow; i++){
row_mst_value = ds_master.ColumnValue(i,1) + ds_master.ColumnValue(i,2).toUpperCase() + ds_master.ColumnValue(i,3)+ ds_master.ColumnValue(i,4);
// 기준이 되는값으로 같은 값이 있는지 비교한다.
for(var k=i+1; k<=ds_master.CountRow; k++){
row_mst_value_ = ds_master.ColumnValue(k,1) + ds_master.ColumnValue(k,2).toUpperCase() + ds_master.ColumnValue(k,3)+ ds_master.ColumnValue(k,4);
//alert(row_mst_value + "" + row_mst_value_);
if (row_mst_value == row_mst_value_){
row_mst_flag = "N";
}
}
if (row_mst_flag == "N"){
cfAlertMsg(TLP_COM_ERR_071);
return;
}
for(var j=1; j<=5; j++){
row_value = ds_master.ColumnValue(i,j);
if (row_value==""){
cfAlertMsg(TLP_COM_ERR_072, [i]);
return false;
}
}
}
return true;
}
function btn_Save() {
if(ds_master.IsUpdated == false){
cfAlertMsg(TLP_COM_INF_015);
return;
}
//필수입력 체크한다.
if(!f_Check()){
return ;
}
if(cfConfirmMsg(TLP_COM_CRM_001)==true){
tr_test.post();
ds_master.reset();
}else{
return;
}
}
/* grid를 생성 */
function gridCreate(){
var auth = "<%=_S_AUTORITY%>";
var editable = "";
if (auth!="HA"){
if (auth!="DA"){
editable = "Edit="None"";
}
}
var hdrProperies =
'<C>id=subsidiary name="Prod.Aera" width=80 align=left EditStyle=Lookup Data="ds_bu:Code:Name" '+ editable + '</c>'
+ '<C>id=nation name="Nation" width=80 align=left </C>'
+ '<C>id=vendorName name="Vendor Name" width=100 align=left '+ editable + '</C>'
+ '<C>id=category name="Category" width=80 align=center '+ editable + '</C>'
+ '<C>id=issueDate name="Issue Date" width=80 align=center '+ editable + '</C>'
+ '<C>id=issue name="Issue" width=100 align=center '+ editable + '</C>'
+ '<C>id=issueFile name="File" width=100 align=center '+ editable + '</C>'
+ '<G>name="improvement"'
+ '<C>id=improvement name="improvement" width=100 align=center '+ editable + '</C>'
+ '<C>id=impUser_id name="impUserId" width=100 align=center '+ editable + '</C>'
+ '<C>id=impDueDate name="impDueDate" width=100 align=center '+ editable + '</C>'
+ '</G>'
+ '<G>name="confirm"'
+ '<C>id=confirm name="confirm" width=100 align=center '+ editable + '</C>'
+ '<C>id=confirmUserId name="confirmUserId" width=100 align=center '+ editable + '</C>'
+ '<C>id=confrimDate name="confrim date" width=100 align=center '+ editable + '</C>'
+ '</G>'
+ '<C>id=remark name="remark" width=100 align=center '+ editable + '</C>'
+ '<C>id=remarkFile name="remarkFile" width=100 align=center '+ editable + '</C>'
+ '<C>id=completeDate name="completeDate" width=100 align=center EditStyle=Combo Data="Y:Y,N:N" '+ editable + '</C>'
;
initGrid(GD_MASTER, "ds_master", hdrProperies,true);
if (auth=="HA"){
GD_MASTER.ColumnProp('regYear', 'Edit') = "Numeric";
GD_MASTER.ColumnProp('regYear', 'EditLimit') = 4;
}
}
</script>
<!-----------------------------------------------------------------------------
D A T A S E T C O M P O N E N T S D E C L A R A T I O N
------------------------------------------------------------------------------>
<comment id="_NSID_"><object id=ds_bu classid=<%=LGauceId.DATASET%>><param name=SyncLoad value="true"></object></comment><script>_ws_(_NSID_);</script>
<comment id="_NSID_"><object id=ds_master classid=<%=LGauceId.DATASET%>></object></comment><script>_ws_(_NSID_);</script>
<comment id="_NSID_">
<OBJECT id=tr_test classid="<%=LGauceId.TR%>">
<param name="KeyName" value="toinb_dataid4">
<param name="KeyValue" value="Servlet(I:IN_DS=ds_master)">
<param name="ServerIP" value="">
<param name="Action" value="<%= contextPath %>/DI.OP.RetrieveDailyIssue.gau">
<param name="Parameters" value="cmd=updateTestList,creator=<%=_S_USR_ID%>,coCompany=<%=_S_COMPANY%>,sSubsidiary=<%=_S_SUBSIDIARY%>">
</OBJECT>
</comment><script>_ws_(_NSID_);</script>
<!-----------------------------------------------------------------------------
G A U C E C O M P O N E N T' S E V E N T S
------------------------------------------------------------------------------>
<!-- BU 콤보 조회 후-->
<script language=JavaScript for=ds_bu event=OnLoadCompleted(rowcnt)>
var s_division = "<%=_S_DIVISION%>";
if (s_division=="Empty"){
s_division = "ALL";
}
initIf(co_bu,ds_bu,"name","code",s_division);
btn_Search();
</script>
<!-----------------------------------------------------------------------------
사용자 개발 스크립트
------------------------------------------------------------------------------>
</head>
<!-----------------------------------------------------------------------------
화면영역 시작
------------------------------------------------------------------------------>
<body onLoad="f_OnLoad()">
<table><tr><td height=5></td></tr></table>
<table cellpadding="0" cellspacing="0" border=0>
<tr>
<td width="830" valign="top">
<div class="breadcrumb">
Home > <b>Daily Issue</b> > Open
</div>
<!-- 검색부분 시작 -->
<table><tr><td height=5></td></tr></table>
<!-- sub_menu Start -->
<% String sub_page = "S_DI_OP_001";%>
<%@include file="/sys/include/sub_menu.jsp"%>
<!-- sub_menu end -->
<!-- 검색부분 시작 2010,04.30 김성도 수정 -->
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr><td class="table_search_line"></td></tr>
<tr class="bg_gray_F7F7F7">
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td>
<!--LuxeCombo : BU -->
<b>BU : </b>
<select id="co_bu" class="input_combobox" style="width:60px;" ></select>
</td>
<td width="380" align=right>
<input name="reset32" type="button" class="button_search" onClick="btn_Search()" value="Search" onMouseOver="this.style.color='#650000'" onMouseOut="this.style.color='#202020'">
<% if ((_S_AUTORITY.equals("HA"))||(_S_AUTORITY.equals("DA"))){ %>
<input name="row_add" type="button" class="button_default" value="Row Add" onclick="btn_Add()" onmouseover="this.style.color='#650000'" onmouseout="this.style.color='#202020'">
<input name="row_del" type="button" class="button_default" value="Row Delete" onclick="btn_Delete()" onmouseover="this.style.color='#650000'" onmouseout="this.style.color='#202020'">
<input name="save" type="button" class="button_search" value="Save" onclick="btn_Save()" onMouseOver="this.style.color='#650000'" onMouseOut="this.style.color='#202020'">
<%} %>
<input name="btnExcel" type="button" class="button_default" value="Excel" onClick="btn_ExcelDown();" onmouseover="this.style.color='#650000'" onmouseout="this.style.color='#202020'">
</td>
</tr>
</table>
</td>
</tr>
<tr><td class="table_search_line"></td></tr>
</table>
<!-- 검색부분 끝 2010,04.30 김성도 수정 -->
<table><tr><td height=5></td></tr></table>
<!-- contents start -->
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="table_line_simple">
<tr>
<td align="left" class="bg_white">
<!--Grid Component-->
<comment id="_NSID_">
<object id="GD_MASTER" width="100%" classid=<%=LGauceId.GRID%>>
<param name=MultiRowSelect value="true">
</object>
</comment>
<SCRIPT>_ws_(_NSID_);</SCRIPT>
</td>
</tr>
</table>
<!-- contents end -->
</td>
</tr>
</table>
</body>