oracle apex redirect to modal dialoge page from pl/sql code

主宰稳场 提交于 2020-01-05 05:08:40

问题


I have a page process in my apex page. I want to redirect to a modal dialoge page after the page process finishes. So I wrote the code

htp.init;
owa_util.redirect_url('f?p=&APP_ID.:34:APP_SESSION.::NO:34:P34_CODE,P34_DAY_DATE:P30_CODE.,'||:P30_DAY_DT); 
apex_application.stop_apex_engine;

The page 34 is a modal dialoge page . Hence it shows error

page 34 cannot be rendered successfully. Ensure the page template in use on page 34 is of template type "Dialog page", with appropriate JavaScript dialog initialization, dialog closure and dialog cancel code defined.

Then I tried with

 l_url:=APEX_UTIL.PREPARE_URL('f?p=&APP_ID.:34:APP_SESSION.::NO::P34_CODE,P34_DAY_DATE:P30_CODE.,'||:P30_DAY_DT',p_checksum_type=>'SESSION'); 
 htp.init;
 apex_util.redirect_url(l_url);
 apex_application.stop_apex_engine;  

That too didn't worked for me. Anybody have solution?


回答1:


create a dynamic action for the button, copy the pl/sql code in page process and then add an action "execute pl/sql code" in dynamic action.Paste the copied code there.

declare
   v_url varchar2(4000);
begin

   v_url:=apex_util.prepare_url
                  (p_url             =>  'f?p=&APP_ID.:34:&SESSION.:::34:P34_CODE:'|| :P30_CNAME,
                   p_triggering_element      =>'$(''#URLS'')'
                  );
   :p30_URL:=v_url;
end;

after this pl/sql, create a javascript action for the same dynamic action and write

 eval($('#P30_URL').val());

eval() is a default js method.This will redirect to modal page



来源:https://stackoverflow.com/questions/48474907/oracle-apex-redirect-to-modal-dialoge-page-from-pl-sql-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!