如何使用Oracle Apex中的分支重定向到不同页面?

发布于 2025-02-09 15:43:14 字数 895 浏览 1 评论 0原文

我定义了返回URL的函数(重定向)。

branch

预先渲染 - 在标题之前 - 分支机构

使用以下脚本:

declare
  x number:=1;
  myurl varchar2(255);
begin
  if v('AGENCY') = 'R-AG' then
     x := 3; 
     myurl := 'f?p=&APP_ID.:3:&SESSION.'; ---page 3
  else
     x := 50; 
     myurl := 'f?p=&APP_ID.:50:&SESSION.'; --- page 50
  end if;
  return myurl;
end;

我已经定义了项目应用程序

  1. 名称:代理
  2. 范围:应用程序
  3. 会话状态保护:无限制

我已经定义了应用程序计算/strong>

  1. 序列:10

  2. 计算项目:代理

  3. 计算点:

    之后
  4. 身份验证计算类型:sql query(返回单值)

  5. 计算:

    选择ROL 来自用户;

,但出于某种原因,该分支仅将第3页作为优先级,而“否则”在情况下并未实现为第50页。

I have defined a function returning a URL(redirect).

branch

Page 1: Home-
Pre-Rendering-
Before Header-
Branches

With the following script:

declare
  x number:=1;
  myurl varchar2(255);
begin
  if v('AGENCY') = 'R-AG' then
     x := 3; 
     myurl := 'f?p=&APP_ID.:3:&SESSION.'; ---page 3
  else
     x := 50; 
     myurl := 'f?p=&APP_ID.:50:&SESSION.'; --- page 50
  end if;
  return myurl;
end;

I have defined item applications

  1. Name : AGENCY
  2. Scope : Application
  3. Session State Protection: Unrestricted

I have defined an application computation

  1. Sequence :10

  2. Computation Item: AGENCY

  3. Computacion Point: After

  4. Authentication Computacion Type: SQL Query(return single value)

  5. Computacion:

    SELECT ROL
    FROM USERS;

But for some reason the branch only took page 3 as priority and "else" is not fulfilled to redirect to page 50 when it is the case.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

维持三分热 2025-02-16 15:43:14

您的计算看起来像是应该具有过滤器的东西 - 从没有过滤器的“用户”中返回了多少行?
尽管如果有任何问题,我会认为P50将是结果。

您也可以更声明地做到这一点。如在IN时,在项目代理= R-AG时拥有第3页的分支,而在没有条件的情况下,第二个分支到P50。

您的第一个分支到P3也可能只有一个查询返回行,例如

select null
from users
where username = :app_user -- or whatever your filter should probably be here
and rol = 'R-AG'

Your computation looks like something that should have a filter - how many rows return from a select from 'users' with no filter?
Though if there were any issues from that, I would have thought p50 would be the result.

You could also do this more declaratively. As in, have a branch to page 3 when item AGENCY = R-AG, and a second branch to p50 with no condition.

You first branch to p3 could also have just a query returning rows, such as

select null
from users
where username = :app_user -- or whatever your filter should probably be here
and rol = 'R-AG'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文