window


showWindow

해당 winId를 가지는 윈도우를 생성하거나 생성되어 있는 경우 최상단으로 이동 후 보여준다.

showWindow는 4.2.8 버전 이상 부터 제공된다.

제약사항

현재 윈도우가 팝업 윈도우인 경우 새로운 팝업 윈도우 생성만 가능하다.
(일반 윈도우를 생성하거나 윈도우 간 이동 등 모두 불가함)

options

필드설명비고M/O
winId 윈도우 아이디 
url비즈앱 또는 웹 화면 경로비즈앱 경로의 경우 비즈앱 root폴더 기준 절대경로를 기입,
http 또는 https scheme이 있는 경우 웹 화면 경로로 인식
params윈도우에 전달할 Map 형태의 파라미터 
animated원도우 생성 및 종료시 애니메이션 실행 여부HSP 에 내장되어 있는 애니메이션 리소스를 통해 화면을 출력 한다.O
     

successCallback

필드설명
없음없음
   

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

var winId = 'id';
var url = 'index.html'; // http 또는 https scheme이 없는 경우 비즈앱 경로로 인식
var params = { // 전달할 파라미터
   "key" : "value"
};

var animated = false;

hone.channel.execute('window', 'showWindow', [winId, url, params, animated],
   function() {
       // success callback
},
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

sendMessage

해당 winId를 가지는 윈도우에 Map 형태의 메세지를 전달한다.

showWindow는 4.2.8 버전 이상 부터 제공된다.

제약사항

Window에서 메세지를 전달받기 위해서는 honeMessageReceived 이벤트 핸들러 등록이 필요하다.
이벤트 핸들러 등록은 Bizapp Guide 의 honeMessageReceived Event 등록 내용을 참조한다.

options

필드설명M/O
winId 윈도우 아이디M
messageMap 형태의 메세지M
   

successCallback

필드설명
없음없음
   

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

var winId = 'id';
var message = { // 전달할 메세지
   "key" : "value"
};

hone.channel.execute('window', 'sendMessage', [winId, message],
   function() {
       // success callback
   },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

hasWindow

해당 winId를 가지는 윈도우가 이미 생생되었는지 여부를 확인한다.

showWindow는 4.2.8 버전 이상 부터 제공된다.

options

필드설명M/O
winId 윈도우 아이디M
   

successCallback

필드설명
result해당 winId의 윈도우가 존재하는지 여부 boolean 값
   

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

var winId = 'id';

hone.channel.execute('window', 'hasWindow', [winId],
   function(result) {
      // success callback
      if (result) {
          // 이미 생성된 window 객체가 있는 경우
      } else {
          // 이미 생성된 window 객체가 없는 경우
      }
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

Result

"true"

destroyWindow

해당 winId를 가지는 윈도우를 삭제한다.

showWindow는 4.2.8 버전 이상 부터 제공된다.

제약사항

현재 윈도우가 팝업 윈도우인 경우 현재 윈도우만 삭제 가능하다.

options

필드설명M/O
winId 윈도우 아이디M
   

Example

var winId = 'id';

hone.channel.execute('window', 'destroyWindow', [winId]);

clearCache

캐시는 애플리케이션별로 이루어지므로 사용된 모든 WebView에 대한 캐시가 지워집니다.

showWindow는 4.2.8 버전 이상 부터 제공된다.

Example

hone.channel.execute('window', 'clearCache', []);

goBack

웹뷰 내 탐색할 수 있는 이전 항목이 존재한다면 이전 페이지로 이동합니다.

Example

hone.channel.execute('window', 'goBack', []);

canGoBack

웹뷰 내 탐색할 수 있는 이전 항목이 존재하는지 체크합니다.

successCallback

필드설명
result뒤로가기 가능 여부
  

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

hone.channel.execute('window', 'canGoBack', [],
   function(result) {
       if (result) {
           // true
       } else {
           // false
       }
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

Result

"true"

goForward

뷰 내 탐색할 수 있는 다음 항목이 존재한다면 다음 페이지로 이동합니다.

showWindow는 4.2.8 버전 이상 부터 제공된다.

Example

hone.channel.execute('window', 'goForward', []);

canGoForward

웹뷰 내 탐색할 수 있는 다음 항목이 존재하는지 체크합니다.

successCallback

필드설명
result앞으로가기 가능 여부
   

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

hone.channel.execute('window', 'canGoForward', [],
   function(result) {
       if (result) {
           // true
       } else {
           // false
       }
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

Result

"true"

showLoadingScreen

오래걸리는 작업을 시작하기 전에 사용자의 입력을 막기 위해 사용할 수 있는 loading popup을 보여준다

options

필드설명M/O
message 로딩팝업에 표시할 안내 문구 메시지O
   

Example

var message = 'message';
hone.channel.execute('window', 'showLoadingScreen', [message]);

hideLoadingScreen

표시중인 loading popup을 hide한다.

Example

hone.channel.execute('window', 'hideLoadingScreen', []);

alert

honemobile 에서 제공하는 경고창을 띄운다

options

필드설명M/O
title경고창 제목O
message경고창 내용O
   

Example

var title = 'title';
var message = 'message';
hone.channel.execute('window', 'alert', [title, message]);

confirm

honemobile 에서 제공하는 확인창을 띄운다

options

필드설명M/O
title확인창 제목O
message확인창 내용O
   

successCallback

필드설명
result

true (YES 버튼 선택 시)

false (NO 버튼 선택 시)

  

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

var title = 'title';
var message = 'message';
hone.channel.execute('window', 'confirm', [title, message],
   function(result) {
       // success callback
       JSON.stringify(result);
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

Result

"true"

fullscreen

화면을 전체 화면으로 변경 하거나 복구 한다. 

fullScreen는 3.0.0 버전 이상 부터 제공된다.

successCallback

필드설명
없음없음
   

errorCallback

필드설명
code에러코드
message에러메세지
  

options

필드설명M/O
options
  • true : 전체화면으로 설정
  • false : 일반화면으로 설정
M
   

Example

hone.channel.execute('window', 'fullscreen', [true],
   function () {
        alert('changed fullscreen');
    }, function (e) {
        alert(JSON.stringify(e));
    }
);

isFullscreen

현재 화면이 Full Screen 인지 확인 한다. 

isFullScreen는 3.0.0 버전 이상 부터 제공된다.

successCallback

필드설명
resultfull 스크린 여부
     

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

hone.channel.execute('window', 'isFullscreen', [],
   function (result) {
        alert('fullscreen : ' + result);
    }, function (e) {
        alert(JSON.stringify(e));
    }
);

Result

"true"

orientation

현재의 Orientation 을 반환 한다. 

Orientation는 3.0.0 버전 이상 부터 제공된다.

successCallback

필드설명
없음없음
   

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

hone.channel.execute('window', 'orientation', [],
   function (result) {
        alert('orientation : ' + result);
    }, function (e) {
        alert(JSON.stringify(e));
    }
);

Result

결과 값은 1 (Portrait), 2(Landscape) 으로 전달 된다. 

1

exitApp

런처앱을 종료합니다.

Example

hone.channel.execute('window', 'exitApp', []);

Error Code

CodeCauseComment
E11500파라메터 값이 잘못되어 있을 경우 
E11501전달된 액션 값이 알 수 없는 액션일 경우 
E11502윈도우 이름이 잘못되어 있을 경우 
E11503Fullscreen 설정을 위한 값이 잘못되어 있을 경우 
E11504윈도우 간에 메시지 전송을 위한 값이 잘못되어 있을 경우 
E11550실행 중 오류가 발생 되었을 경우 
E11551assets/config/window.json 에 설정해둔 Window 가 존재하지 않는 경우 
E11552윈도우 생성에 실패한 경우 
E11553윈도우 삭제 시 생성된 윈도우가 존재하지 않는 경우 
E11554윈도우 생성 및 이동시 현재 윈도우가 팝업 윈도우인 경우 
E11555윈도우 간에 메시지가 전달되지 않는 경우 
E11556설치 된 비즈앱이 존재하지 않은 경우 
E11557요청한 비즈앱 경로의 페이지를 찾을 수 없는 경우 
E11558요청한 비즈앱의 경로가 비즈앱이 설치 된 경로 외 파일에 접근을 할 경우 
E11599알 수 없는 오류가 발생 되었을 경우