关闭模式对话框页面时出现重定向到另一页面的问题 [英] Having issues redirecting to another page on closing of modal dialog page

查看:81
本文介绍了关闭模式对话框页面时出现重定向到另一页面的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有第1页,从中打开了一个模态对话框页-第2页.现在,当我关闭模态对话框时,我想重定向到第3页.在第2页上,我有一个按钮,该按钮的动态动作定义在哪里单击按钮时,将采取两种操作:页面提交"(提交后"分支进入第3页)和关闭"对话框.单击按钮后,对话框关闭,但用户停留在页面1上,而不是页面3上.

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.

推荐答案

如果您有分支,则无需关闭对话框.

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

另一种选择是使用PL/SQL-JS组合浏览页面,并在服务器上运行代码后重定向到URL.

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

  1. 创建一个名为P2_TARGET的隐藏的不受保护的物品
  2. 创建具有由动态操作定义的操作的按钮,
  3. 为该按钮添加动态操作onClick,其中包含两个真实的操作:

  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.执行PL/SQL代码,提交P2_Item,返回P2_TARGET

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.执行Javascript代码:

b. Execute Javascript code:

eval($v('P2_TARGET'));

这应该可以解决问题

这篇关于关闭模式对话框页面时出现重定向到另一页面的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆