20250218 - 여러 종류 메세지 보이기

 // 기본 alert 대신:

apex.message.showPageSuccess('저장되었습니다');  // 성공 메시지 (초록색)

apex.message.showPageError('오류가 발생했습니다');    // 에러 메시지 (빨간색)

apex.message.showPageWarning('주의가 필요합니다');    // 경고 메시지 (노란색)

apex.message.showPageInfo('참고해주세요');      // 정보 메시지 (파란색)


// 타이틀과 함께 표시:

apex.message.alert('메시지 내용', '타이틀');  // 확인 버튼이 있는 모달 창


// 콜백 함수 사용:

apex.message.confirm('저장하시겠습니까?', function(okPressed) {

    if (okPressed) {

        // OK 버튼 눌렀을 때 실행할 코드

    }

});


// 자동으로 사라지는 메시지:

apex.message.clearErrors();

apex.message.showPageSuccess('저장되었습니다', function() {

    // 3초 후 자동으로 사라짐

});


//아이콘 포함


('#SID_BTN_RADMIN').on('click', function(e) {
   e.preventDefault();
   apex.message.clearErrors();
   
   apex.message.confirm("진행을 취소하고 관리 메인 페이지로 이동하시겠습니까?", function(okPressed) {
       if (okPressed) {
           const url = `f?p=${$v('pFlowId')}:200:${$v('pInstance')}::NO:::`;
           
           apex.server.process(
               'AJAX-popup',
               {x01: url},
               {
                   success: function(pData) {
                       pData = pData.replace(",this", ",'#SID_BTN_RADMIN'");
                       apex.navigation.redirect(pData);
                   },
                   error: function() {
                       apex.message.alert("페이지 이동 중 오류가 발생했습니다.");
                   },
                   dataType: "text"
               }
           );
       }
   }, {
        title: "확인 요청",
        style: "warning"
   });
});

댓글 없음:

댓글 쓰기

20250315 - 글로벌 변수 Global Variables

G_USER Specifies the currently logged in user. G_FLOW_ID Specifies the ID of the currently running application. G_FLOW_STEP_ID Specifi...