[ Nexacro.Form -  showModeless  ]

 

* 특징 : showModeless 팝업창의 특징은 팝업창을 종료하지 않고도 Main창을 제어할 수 있다.
         이런 특징으로 Main창에서 다시 팝업창을 호출 할 수 있게 된다.
         이때 다시 팝업창을 Open하면 오류(내용은 아래 존재)가 발생하게 된다.
         
         이런 이유로 기존 팝업창을 close하고 다시 띄워야 된다.
         하지만 close하지 않고도 팝업창이 이미 띄워져 있는 지 검사하여 해당 팝업창을
         제어 할 수도 있다.

* 존재 하는 팝업창을 다시 띄우면 나는 오류
  [(US231022)는 이미 실행중입니다. 같은 ID로 동시에 여러 개의 창을 띄울수 없습니다. ]

☞ 예문1) 기존 팝업창을 찾아서 argument를 넘기고, function을 제어 하는 방법
 

/*++
@desc    Grid를 double click시
*/

function fn_ApprovalPouUp(obj:Grid, e:GridClickEventInfo)
{
    
if (e.row < 0) return;
    
    
var oParam = new Object();
    
var sSO_NO = ds_SoList.getColumn(e.row, "SO_NO");
    oParam = {pSO_NO:sSO_NO};

    if (application.popupframes["US231022"]){
        application.popupframes["
US231022"].form.pSO_NO=sSO_NO;
        application.popupframes["
US231022"].form.fn_Onload();
    }
else{
        cfn_openDialogCenter("
US231022", "HSUS::US231022.xfdl", 800 , 632, "modeless", oParam);
    }
}

☞ 예문2) 기존 팝업창을 종료하고, 신규ID를 부여하여 팝업창을 OPEN
          단점, 팝업창을 사용자가 적당한 곳에 이동했을 경우  다시 띄우므로 항상 중앙에 위치하게 된다.

 

/*++
@desc    Grid를 double click시 팝업창 호출
*/

var pIdx=0;
function fn_ApprovalPouUp(obj:Grid, e:GridClickEventInfo)
{
    
if (e.row < 0) return;    

    var oParam  = new Object();
    oParam = {pSO_NO:ds_SoList.getColumn(e.row, "
SO_NO")};    

    //기 존재 하면 삭제
    
var MDIFrame = application;
    
var i = MDIFrame.all.length;

    while ( i > 0)
    {
        i--;
        
var objChildFrame = MDIFrame.all[i];
        
if( objChildFrame.name == "US231022_" + pIdx ){
            objChildFrame.form.close();
            break;
        }
    }
    pIdx ++;
    
    
//신규로 다시 호출
    cfn_openDialogCenter("
US231022_" + pIdx, "HSUS::US231022.xfdl", 800 , 632, "modeless", oParam);

}


 

 
 
   
 

/*******************************************************************************
 * 기능 : 파라메터가 있는 다이얼로그 창을 타입별로 띄운다
 * 인자 : 화면아이디, URL, 가로, 세로, 타입, 파라메터
 * 리턴 : 팝업창에서 넘겨 받은 결과값
******************************************************************************
/  
function cfn_openDialogCenter(strid, url, width, height, type, arg, resize)
{
    
var i, nRow, objChildFrame;
        
    
var arrFramelist = this.getOwnerFrame().all;
    
for(i=0; i<arrFramelist.length; i++){
        
if(arrFramelist[i].name == strid) {
            
return false;
        }
    } 

    objChildFrame = new ChildFrame();   

    //다이얼로그 뜨는 위치 계산
    
var nMoniterIndex = system.getMonitorIndex(system.cursorx, system.cursory); //다중 모니터일 경우 사용중인 모니터 인덱스를 구함.
    
var strScreenRes  = system.getScreenResolution(nMoniterIndex);
    
var nCenterX      = new Number(strScreenRes.split(" ")[0]);
    
var nCenterY      = new Number(strScreenRes.split(" ")[1]);
    

    // 모니터의 중앙이 아닌 포털의 중앙에 뜨게 변경 BEGIN

    
var nAppWidth   = application.mainframe.position.right  - application.mainframe.position.left;
    
var nAppHeight  = application.mainframe.position.bottom - application.mainframe.position.top;
    
var nAppCenterX = application.mainframe.position.right  - (nAppWidth / 2);
    
var nAppCenterY = application.mainframe.position.bottom - (nAppHeight / 2);
    posX = Math.round(nAppCenterX - (width / 2));
    posY = Math.round(nAppCenterY - (height / 2));
    
// 모니터의 중앙이 아닌 포털의 중앙에 뜨게 변경 END    

    objChildFrame.init(strid, posX, posY, width, height, url);
    
if (resize==null) objChildFrame.resizable = true;
    else objChildFrame.resizable =resize;
    objChildFrame.showtitlebar =
true;
    objChildFrame.layered      =
true;
    
if(type != "notice"){
        objChildFrame.style.background = "
white";
        objChildFrame.style.bordertype = "
round 7 7";
    }

    var result = "";    

    // Show Object  
    
if(type == "modeless"){
        objChildFrame.showModeless(
this.getOwnerFrame(), arg);
    }
    
else if(type == "modal" || type == "notice"){
        result = objChildFrame.showModal(
this.getOwnerFrame(), arg);
    }
    
else {
        result = objChildFrame.showModal(
this.getOwnerFrame(), arg);
    }

    return result;
}

'Nexacro-Function > Form.PouUp' 카테고리의 다른 글

Nexacro.Form - POP_UP창  (0) 2017.01.28
Posted by 농부지기
,