화면에 설정된 xTranMapID를 기준으로 데이터를 송수신한다. 비동기 통신 방식과 동기 통신 방식은 bProcAsync 파라미터에 의해서 결정되며, 통신 방식에 따라 업무 서버에서 데이터 처리 결과 정보를 확인하는 방법이 다르다. 비동기 통신 방식은 데이터 수신이 완료되면 on_submitcomplete 이벤트가 발생하며, 이 이벤트의 파라미터로 전달되는 정보를 통해 업무 서버에서의 데이터 처리 결과를 확인한다. 동기 통신 방식은 getsubmitresult 함수 호출을 통해 반환되는 처리 결과 오브젝트를 이용하여 업무 서버에서의 데이터 처리 결과 정보를 확인한다.
Parameters | Type | Description |
---|---|---|
strTranMapID | STRING | 전송시 사용할 TranMapID |
bProcAsync | BOOL | 동기/비동기 처리 여부 |
Type | Description |
---|---|
BOOL | 전송 성공/실패 여부 (Remark 참조) |
* Return Value : true
* Return Value : false
// Async 방식 데이터 통신 버튼 : btnAsync
// Sync 방식 데이터 통신 버튼 : btnSync
// Async 방식 데이터 통신 버튼 클릭 이벤트 처리
function btnAsync_on_mouseup()
{
// Async 방식 파라미터 설정
var bRet = screen.requestsubmit("TR_ASYNC", true);
if(bRet == false) {
// 데이터 송신중 오류가 발생하면 "on_submitcomplete" 이벤트가
// 발생하지 않는다.
screen.alert("데이터 송신중 오류가 발생하였습니다.");
}
}
// Async 데이터 통신 방식일때 데이터 수신 완료 이벤트
// 자세한 내용은 on_submitcomplete 도움말 참조
function screen_on_submitcomplete(mapid, result, recv_userheader, recv_code, recv_msg)
{
// 처리 결과를 콘솔에 출력
factory.consoleprint("mapid = " + mapid);
factory.consoleprint("result = " + result);
factory.consoleprint("recv_userheader = " + recv_userheader);
factory.consoleprint("recv_code = " + recv_code);
factory.consoleprint("recv_msg = " + recv_msg);
return;
}
// Async 방식 데이터 통신 버튼 클릭 이벤트 처리
function btnSync_on_mouseup()
{
// Sync 방식 파라미터 설정
var bRet = screen.requestsubmit("xTranMapID_01", false);
if(bRet == false) {
screen.alert("데이터 송신중 오류가 발생하였습니다.");
return;
}
// 데이터 통신 결과 정보 오브젝트를 구함
// 오브젝트에는 on_submitcomplete 이벤트의 파라미터로 전달되는
// 데이터를 포함하고 있음.
var instResult = screen.getsubmitresult();
if(instResult == null) {
screen.alert("데이터 처리 결과를 얻을 수 없습니다.");
return;
}
// 처리 결과를 콘솔에 출력
factory.consoleprint("mapid = " + instResult.mapid);
factory.consoleprint("result = " + instResult.result);
factory.consoleprint("recvuserheader = " + instResult.recvuserheader);
factory.consoleprint("recvcode = " + instResult.recvcode);
factory.consoleprint("recvmsg = " + instResult.recvmsg);
}