cabrillo.modal - 클라이언트

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 3분
  • 카브릴로 JS 네이티브 모달 내에서 웹 컨텐츠를 표시하는 함수입니다.

    cabrillo.modal - dismissModal(객체 데이터)

    presentModal() 함수와 함께 제공된 모달을 해제하는 데 사용합니다.

    제시된 모달은 자신을 해제하고 결과를 제시하는 컨텍스트로 다시 전달하는 역할을 합니다. dismissModal() 함수는 현재 컨텍스트가 아닌 현재 컨텍스트에서 호출되어야 합니다.

    표 1. 매개변수
    이름 유형 설명
    데이터 객체 옵션입니다. 제공된 컨텍스트가 해제될 때 현재 컨텍스트로 다시 전달할 객체입니다.
    표 2. 반환
    유형 설명
    약속 성공하면 해결되지 않은 객체이고, 그렇지 않으면 오류가 표시됩니다.
    // Any object can be passed back to the presenting context when the presented context dismisses itself.
    var results = {
        team: 'Mobile'
        company: 'ServiceNow'
    }
    
    cabrillo.modal.dismissModal(results).then(function() {
        console.log('Modal was dismissed and results were passed to presenting context.');
    }, function(error) {
        console.log(error);
    });

    cabrillo.modal - presentModal( 문자열 제목, 문자열 URL, 문자열 closeButtonStyle, 문자열 modalPresentationStyle)

    네이티브 모달 인터페이스에서 컨텐츠를 표시합니다.

    표 3. 매개변수
    이름 유형 설명
    직위 문자열 모달 인터페이스의 제목입니다.
    URL 문자열 모달을 여는 URL입니다. 내부 인스턴스 URL(정규화 또는 상대, 상대 URL 선호)이어야 합니다.
    closeButton스타일 문자열 모달 인터페이스의 닫기 버튼 스타일입니다.
    가능한 값:
    • cabrillo.modal.CLOSE_BUTTON_STYLE_CANCEL
    • cabrillo.modal.CLOSE_BUTTON_STYLE_CLOSE
    • cabrillo.modal.CLOSE_BUTTON_STYLE_DONE
    자세한 내용은 Cabrillo JS 상수 - 닫기 버튼 스타일 문서를 참조하십시오.
    modalPresentationStyle 문자열 모달 인터페이스의 프레젠테이션 스타일입니다.
    가능한 값:
    • cabrillo.modal.MODAL_PRESENTATION_STYLE_FULL_SCREEN
    • cabrillo.modal.MODAL_PRESENTATION_STYLE_FORM_SHEET
    자세한 내용은 Cabrillo JS 상수 - 모달 프레젠테이션 스타일 문서를 참조하십시오.
    주:
    이 매개변수는 에서만 지원됩니다.Apple iOS
    표 4. 반환
    유형 설명
    약속 성공하면 Cabrillo.ModalResponse 객체이고, 그렇지 않으면 오류가 발생합니다.

    사용자 지정 URL을 로드하는 네이티브 모달을 제공합니다. 그러면 사용자 지정 Service Portal 페이지가 양식 시트 스타일 모달로 표시됩니다. 모달이 해제되면 약속이 이행됩니다. 사용자 지정 해제 기능은 dismissModal() 함수를 참조하십시오.

    cabrillo.modal.presentModal('Portal Page',
        '/$sp.do?id=my_modal_page',
        cabrillo.modal.CLOSE_BUTTON_STYLE_CLOSE,
        cabrillo.modal.MODAL_PRESENTATION_STYLE_FORM_SHEET
    ).then(function(response) {
        // The results from the modal are in a results key on the response object.
        var results = response && response.results ? response.results : null;
    
        if (results) {
            console.log('Modal dismissed with results.', results);
        } else {
            console.log('Modal dismissed without results.');
        }
    }, function(error) {
        console.log(error);
    });