1

When a button is clicked have to open a modal dialog which has Page Access Protection set as "Arguments Must Have Checksum"

On button click I have following DA.

apex.server.process("checksum",{x01:28440,x02:261,x03:1},{dataType:"text",success:function(pData){

    apex.navigation.dialog(pData, { 
                                     height:'674', 
                                     width:'550', 
                                     maxWidth:'960',
                                     modal:true,
                                     dialog:null, 
                                     resizable:true,
                                     minHeight:'500'
                                     },
                                     't-Dialog-page--standard',
                                     $("body"));  
}});

I'm generating URL using APEX_UTIL.PREPARE_URL through Ajax process

htp.p(apex_util.prepare_url('f?p='||apex_application.g_x01||':'||apex_application.g_x02||':'||:APP_SESSION||'::NO::P261_ID:'||apex_application.g_x03));

The window never opens. I get an error in console

enter image description here

However when window is opened using eval it works fine.

I also tried extracting the checksum and appending it to the url and then use apex.navigation.dialog as below

    var url = 'f?p=28440:2681:&APP_SESSION.::NO::P2681_ID:1';
    apex.server.process("checksum", { x01: 28440, x02: 2681, x03: 1 }, {
    dataType: "text", success: function (pData) {
        console.log(pData);  //p_dialog_cs=oq5VvyL4Xw6lgHA6szuJNIEkxHtPxvtWLWNAG- yuntSw2ULjT04BDN65sNIN1o_rtRszjFylOiCEiOppQryhmw
        apex.navigation.dialog(url + ",&" + pData, {
            height: '674',
            width: '550',
            maxWidth: '960',
            modal: true,
            dialog: null,
            resizable: true,
            minHeight: '500'
        },
            't-Dialog-page--standard',
            $("body"));

    }
    });

It gives below error in modal dialog

enter image description here

Any help is appreciated.

4

1 回答 1

0

根据您的第二张图片,您尝试打开的对话框需要校验和。为此,您需要在 apex_util.prepare_url 上添加第二个参数。检查这个例子:

apex_util.prepare_url(p_url => 'f?p=801001:3:'||v('APP_SESSION')||'::NO:3::'
                      ,p_checksum_type => 'SESSION');

希望它有帮助..问候

于 2021-03-23T20:42:25.910 回答