/* var TYPE_NOTICE = 0; var TYPE_WARN = 1; var TYPE_ASK = 2; var TYPE_ASK = 3; var TYPE_ERROR = 4; */ function WebMsgDialog(ctxPath) { /* public properties */ this.TYPE_NOTICE = 0; this.TYPE_WARN = 1; this.TYPE_ASK = 2; this.TYPE_ERROR = 3; this.TYPE_CONFIRM = 4; /* private properties */ this._ctxPath = ctxPath; } WebMsgDialog.prototype.showMessageBox = function(msgType,msgContents,detailContents,delayTime) { var msgURL = "/common/msgBox.do"; var pObj = new Object(); pObj.msgType = msgType; //pObj.msgTitle = msgTitle; pObj.msgContents = msgContents; pObj.detailContents = detailContents; pObj.delayTime = delayTime; if(this._ctxPath!= null && this._ctxPath != "") { msgURL = this._ctxPath + msgURL; } msgURL = msgURL +"?msgType="+msgType; //alert("msgURL="+msgURL); //alert("msgType="+pObj.msgType+",msgContents="+msgContents); var Obj = window.showModalDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no'); return Obj; } WebMsgDialog.prototype.showMessageLessBox = function(msgType,msgContents,detailContents,delayTime) { var msgURL = "/common/msgBox.do"; var pObj = new Object(); pObj.msgType = msgType; //pObj.msgTitle = msgTitle; pObj.msgContents = msgContents; pObj.detailContents = detailContents; pObj.delayTime = delayTime; if(this._ctxPath!= null && this._ctxPath != "") { msgURL = this._ctxPath + msgURL; } msgURL = msgURL +"?msgType="+msgType; //alert("msgURL="+msgURL); //alert("msgType="+pObj.msgType+",msgContents="+msgContents); var Obj = window.showModelessDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no'); return Obj; } WebMsgDialog.prototype.showIndexMessageBox = function(msgType,msgContents,detailContents,delayTime) { var msgURL = "/msgbox.jsp"; var pObj = new Object(); pObj.msgType = msgType; //pObj.msgTitle = msgTitle; pObj.msgContents = msgContents; pObj.detailContents = detailContents; pObj.delayTime = delayTime; if(this._ctxPath!= null && this._ctxPath != "") { msgURL = this._ctxPath + msgURL; } msgURL = msgURL +"?msgType="+msgType; //alert("msgURL="+msgURL); //alert("msgType="+pObj.msgType+",msgContents="+msgContents); var Obj = window.showModalDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no'); return Obj; } WebMsgDialog.prototype.showIndexAskMessageBox = function(msgType,msgContents,detailContents,delayTime) { var msgURL = "/askMsgbox.jsp"; var pObj = new Object(); pObj.msgType = msgType; //pObj.msgTitle = msgTitle; pObj.msgContents = msgContents; pObj.detailContents = detailContents; pObj.delayTime = delayTime; if(this._ctxPath!= null && this._ctxPath != "") { msgURL = this._ctxPath + msgURL; } msgURL = msgURL +"?msgType="+msgType; //alert("msgURL="+msgURL); //alert("msgType="+pObj.msgType+",msgContents="+msgContents); var Obj = window.showModalDialog(msgURL,pObj,'dialogWidth:429px;DialogHeight=208px;help:no;status:no'); return Obj; } function cmd_OK() { var obj = new Object(); obj.id=1; window.returnValue = obj; window.close(); } function cmd_NO() { var obj = new Object(); obj.id=0; window.returnValue = obj; window.close(); } function cmd_detail() { var display = document.all("detailID").style.display; var preHeight = document.all("detailTdID").clientHeight; if(display == "none"){ document.all("detailID").style.display = ""; }else{ document.all("detailID").style.display = "none"; } var curHeight = document.all("detailTdID").clientHeight; //alert("curHeight - preHeight="+curHeight - preHeight); //alert("preHeight="+preHeight+",curHeight="+curHeight); resetDialog(curHeight - preHeight); } function resetDialog(vl){ var indexOfp = dialogHeight.indexOf("p"); var dialogHeightInt = parseInt(dialogHeight.substring(0,indexOfp)); //alert("vl="+vl); window.dialogHeight = dialogHeightInt + vl + "px"; } function setMsgBoxData() { var argArray = new Array(window.dialogArguments); //alert(argArray.length); var valueObj = new Object(); valueObj = argArray[0]; //alert("msgType="+valueObj.msgType+",msgTitle="+valueObj.msgTitle+",msgContents="+valueObj.msgContents); var preCtHeight = document.all("windowHeight").clientHeight; var preDialogHeight = window.dialogHeight; var addHeight = document.body.scrollHeight - document.body.clientHeight //alert("preCtHeight="+preCtHeight+",preDialogHeight="+preDialogHeight); document.all("msgContentID").innerHTML = valueObj.msgContents; if(valueObj.detailContents != null && valueObj.detailContents != "") { document.all("detailCtID").value = valueObj.detailContents; }else{ document.all("detailBtID").innerHTML=""; } //alert( document.all("trID").clientHeight); var ctHeight = document.all("windowHeight").clientHeight; var increasedHeight = parseInt(ctHeight) - parseInt(preCtHeight); // alert("increasedHeight="+increasedHeight); var dialogHeight = window.dialogHeight; var indexOfp = dialogHeight.indexOf("p"); var dialogHeightInt = parseInt(dialogHeight.substring(0,indexOfp)); //alert("dialogHeightInt="+dialogHeightInt); window.dialogHeight = dialogHeightInt + increasedHeight + addHeight + "px"; //alert("dialogHeight="+window.dialogHeight); if(valueObj.delayTime != null && valueObj.delayTime != "") { setTimeout("window.close()",valueObj.delayTime); } }