Having issues redirecting to another page on closi

2019-07-26 23:48发布

问题:

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