[ Nexacro-FrameWork1. step4.Frame에서 업무화면 함수호출 ]

 

1. 정의
   1. frame단에서 업무화면의 함수를 호출 하는 경우가 존재 한다.
      좋은 예로,  tabpage에서 [x]를 눌러 화면을 닫을 수 있는데
      만약, 화면에서 변경된 자료가 존재 할 경우는 닫지 않는 경우가 발생한다.
      이때 tabpage를 먼저 delete하고 화면을 받으려 하다고  자료 변경건으로
      화면을 닫지 못할 경우에 tabpage는 삭제 되고, 화면이 닫혀진 문제가 발생한다.
     
   2. 이런경우 개발방법은 화면에 존재하는 함수를 호출하여 화면을 닫을 수 있는지 검사하고
      닫을 수 있는 경우에만 tabpage도 삭제 한다.
     
2. tab.xfdl
   1. 업무화면.함수 호출
   2. button 1개, Event 1개 생성
      . id    : btn_fnCall
      . Event : btn_fnCall_onclick1
   3. btn_fnCall_onclick1 script
this.btn_fnCall_onclick1 = function(obj:Button,  e:nexacro.ClickEventInfo)
{
 application.afn_callFormFunction("fn_setOutEditBox", "top에서 호출");
}

3. ADL application script
   1. function 1개 생성
   2. script
this.afn_callFormFunction = function(sFuncNm, sArg){
 this.av_mdiFrameSet[application.gv_activeMenuId].form.fn_callFormFunction(sFuncNm, sArg);
}

4. workMain.xfdl 화면
   1. function 1개 생성
   2. 화면 호출함수가
   2. script
//application(frame)에서 업무화면의 함수를 호출하고 싶을 경우에 사용되는 function
this.fn_callFormFunction = function(sFuncNm, sArg){
 return eval("this.div_work." + sFuncNm).call(this.div_work, sArg);
}

5. commonCode.xfdl 화면
   1. edit box 1개, function 1개 추가
   2. Edit box
      . id : edt_out
      Funciton : fn_setOutEditBox()
   3. script
this.fn_setOutEditBox = function(args){
 this.edt_out.set_value(args);
 return true;
}

 

Posted by 농부지기
,