Oracle apex 5 - 从动态操作重定向到页面

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39295581/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:17:57  来源:igfitidea点击:

Oracle apex 5 - redirecting to page from a dynamic action

javascriptoracleoracle-apex

提问by Kantoci

I have a classic report where the last few columns are fa icons.

我有一个经典报告,其中最后几列是 fa 图标。

Using jQuerySelector i capture the "on click" event.

使用 jQuerySelector 我捕获“点击”事件。

I do some calculations, and get back a number that I wanna pass to another page. I assign that number to a page item, that has an "on-change" event. Inside the event I have an "Execute JavaScript Code" containing the following:

我做了一些计算,并得到一个我想传递到另一个页面的数字。我将该编号分配给具有“on-change”事件的页面项目。在事件内部,我有一个“执行 JavaScript 代码”,其中包含以下内容:

var href = 'f?p=&APP_ID.:41:&SESSION.::::P41_ITEM:' +  $("#P40_ITEM").val();

window.location = href;

Now... the thing that bothers me the most with this, is that I already have code like this inside a dynamic tree, that's used for navigation, and it works as expected. But this get's bypassed all together. I encapsulated the "Execute JavaScript Code" with two "Execute PL/SQL Code" blocks with logs, and both of them recorded in the logs. Also, when i had "Fire on Page Load" set to yes the redirect happens.

现在......最让我烦恼的是,我已经在动态树中拥有这样的代码,用于导航,并且按预期工作。但这一切都被绕过了。我把“执行JavaScript代码”用两个带日志的“执行PL/SQL代码”块封装起来,都记录在日志中。此外,当我将“页面加载时触发”设置为是时,会发生重定向。

I also tried something like this, thinking there's some mysterious reason it won't execute js code:

我也尝试过这样的事情,认为有一些神秘的原因它不会执行js代码:

owa_util.redirect_url('f?p=&APP_ID.:10:&APP_SESSION.');

apex_application.stop_apex_engine;

but this also doesn't work(can't even find if it's even suported in apex 5).

但这也不起作用(甚至无法找到它是否在 apex 5 中得到支持)。

Does anyone know of a reason why this isn't working? Or another way to call a page redirect from a dynamic action? tnx

有谁知道这不起作用的原因?或者从动态操作调用页面重定向的另一种方法?tnx

回答by bostrowski

You already answered your question with the comment

您已经通过评论回答了您的问题

Or if there's a way to fake a request, so i can submit and initiate a branch?

或者是否有办法伪造请求,以便我可以提交并启动一个分支?

In dynamic action that listens to change eventcreate Trueaction submitafter Execute JavaScript Code.

在动态的行动,听取change event创建True行动submit之后Execute JavaScript Code

If you have trouble doing it, recreate the scenario on apex.oracle.com. Provide login credentials and I will check what you are doing wrong.

如果您在操作时遇到问题,请在 apex.oracle.com 上重新创建场景。提供登录凭据,我会检查您做错了什么。

回答by Kantoci

Sorry for not replying sooner. All your answers are probably correct, but i didn't get the chance to use them - as soon as i read my own highlighted text :) i figured what i was doing wrong. I put some of the logic in dynamic events and some of it in branch/process.. so yeah.. that didn't work.. fixed that up and all was well..

抱歉没有早点回复。您的所有答案可能都是正确的,但我没有机会使用它们 - 一旦我阅读了自己突出显示的文本 :) 我就知道我做错了什么。我把一些逻辑放在动态事件中,其中一些放在分支/流程中..所以是的..那不起作用..修复了它,一切都很好..