123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- //2008-04-14 오후 1:48:36 강지훈 최초 작성
- //컴포넌트 명, 인스턴스명, 체크박스 순서
- function SetVisible(comp_id, inst_id, chkbox_no){
- //alert("1 : " + model.getValue("/root/main/cond/diagcd"));
- var Obj = document.all(comp_id);
- //alert("2 : " + model.getValue("/root/main/cond/diagcd"));
- var stat = model.getValue(inst_id);
-
- if(chkbox_no == null){
-
- if(stat == "Y"){
-
- Obj.visible = true;
- }else{
- Obj.deselect();
- Obj.visible = false;
-
- }
- }
- else if(chkbox_no != null){
-
- var arr = stat.search(chkbox_no);
- if(arr > -1){
- Obj.visible = true;
- }else{
- if(Obj.attribute("ref") != ""){
- model.setValue(Obj.attribute("ref"), "");
- }
- Obj.visible = false;
- }
- }
- }
- /**
- * @---------------------------------------------------
- * @desc : 콘트롤의 값의 길이를 체크
- * @param : String controlID1, String controlID2 컨트롤아이디
- * @return : Boolean true or false
- * @author : 강지훈
- * @exam : fCheckLength("ipt_01", "sct_02", "tar_03");
- * @etc : 입력 컨트롤이 아이디가 "ipt_01"일 경우 messageBox pMessage는 "cap_01" 캡션 컨트롤을 참조 함.
- * @---------------------------------------------------
- */
- function fCheckLength() {
-
- var controlCnt = fCheckLength.arguments.length;
- var controlID, captionID;
- var controlObj, captionObj;
- var controlValue;
- var maxlength;
-
- for(var i=0; i<controlCnt ;i++) {
-
- controlID = fCheckLength.arguments[i];
- controlObj = document.controls(controlID);
-
- if(controlObj != null) { // input control 유무 여부
-
- maxlength = controlObj.attribute("maxlength");
- controlValue = model.getValue(controlObj.attribute("ref"));
-
- if(controlValue.isByteSize(parseInt(maxlength)) == false) {
- captionID = controlID.replace(controlID.substr(0, 3), "cap");
- captionObj = document.controls(captionID);
- if(captionObj != null) { // caption control 유무 여부
- var captionLabel = captionObj.label;
- if(captionLabel.indexOf(":") == captionLabel.length - 1) {
- captionLabel = captionLabel.substr(0, captionLabel.length - 1);
- }
- messageBox(captionLabel + "의 저장 가능 길이가", "E003");
- }
- else
- messageBox("저장 가능 길이가", "E003");
-
- model.setFocus(controlID);
- return false;
- }
- }
- }
- return true;
- }
- function fAnyOneCheck(){
- var controlCnt = fAnyOneCheck.arguments.length;
- var controlID;
- var chkCnt = 0;
-
- for(var i=0; i<controlCnt ;i++) {
- controlID = fAnyOneCheck.arguments[i];
- controlObj = document.controls(controlID);
-
- if(controlObj.value == "") {
- chkCnt++;
- }
- }
- if(controlCnt == chkCnt){
- messageBox("상세사고 내용은", "I003");
- return false;
- }
- else{
- return true;
- }
- }
- // kind D: disable V: visible
- // stat Y: true N: false
- function groupRevitalize(groupNM, kind, stat){
- var Obj = document.all(groupNM);
- var childrenObj = Obj.children;
- for(i=0; i< childrenObj.length; i++)
- {
- childObj = childrenObj.item(i);
- if(kind == "D"){
- if(stat == "Y"){
- childObj.disabled = true;
- }
- else if(stat == "N"){
- childObj.disabled = false;
- }
- }
- else if(kind == "V"){
- if(stat == "Y"){
- childObj.visible = true;
- }
- else if(stat == "N"){
- childObj.visible = false;
- }
- }
- }
- }
- /**
- * 임상에서 담당의/당직의 호출시간 및 중재시간이 있을경우 시간입력 Input 컴포넌트 활성화를 위한 함수
- */
- function checkedVisibleInput(dateObj, dateNode, checkedValue){
-
- if(checkedValue == "N" ){
- dateObj.disabled = true;
- model.setValue(dateNode, "");
- }else if(checkedValue == "Y"){
- dateObj.disabled = false;
- }
-
- dateObj.refresh();
- }
|