Having issues redirecting to another page on closing of modal dialog page

我怕爱的太早我们不能终老 提交于 2020-01-05 07:10:29

问题


I have page 1 from which I open a modal dialog page - page 2. Now when I close the modal dialog, I want to be redirected to page 3. On page 2 I have a button that has a dynamic action defined where on button click two actions take pace: Page Submit (with an after submit branch out to page 3) and Close dialog. Once I click on the button, dialog closes but the user stays on page 1, not going to page 3.


回答1:


If you have branch, you don't need to close dialog..

Another option is to travel through pages using PL/SQL-JS combination that redirects to URL after running code on server.

  1. create a hidden, unprotected item called P2_TARGET
  2. create a button with action defined by dynamic action,
  3. add a dynamic action onClick for that button, with two true actions:

    a. Execute PL/SQL code, submit P2_Item, return P2_TARGET

    declare
        js_code varchar(4000);
    begin
        js_code := REGEXP_REPLACE(
                     APEX_PAGE.GET_URL (
                         p_page => 3,
                         p_clear_cache => 3,
                         p_items  => 'P3_Item',
                         p_values => :P2_Item
                     )
            ,'\,this\)'
            ,q'<,$('#p1Region'))>' -- jQuery of event source
        );
    
        apex_util.set_session_state('P2_TARGET', js_code); 
    end;
    

    b. Execute Javascript code:

    eval($v('P2_TARGET'));
    

and that's supposed to do the trick



来源:https://stackoverflow.com/questions/55264858/having-issues-redirecting-to-another-page-on-closing-of-modal-dialog-page

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