首页 > 解决方案 > Oracle APEX show button when multiple conditions are met

问题描述

I have a couple of dropdowns on my page, a hidden item and a button.

Whenever user changes the value of P1_DD1 or P1_DD2, I need to show the button if one of the following met:

1) If P1_HIDDEN='YES' and both P1_DD1 and P1_DD2 are not null

or

2) If P1_HIDDEN='NO' and P1_DD1 is not null

what is the best way to do this?

I originally added dynamic actions to both P1_DD1 and P1_DD2 on change and for P1_DD1 add set Client-side condition to Item IS NOT NULL and set the item to P1_DD1 and Server-side condition PL/SQL Ex[pression: :P1_HIDDEN='NO'

that works fine. The issue is with P1_DD2. I tried using similar logic - add client-side condition where P1_DD2 is not null and then add server-side condition PL/SQL Expression :P1_HIDDEN='YES' AND P1_DD1 IS NOT NULL but nothing happens. Trying to figure out why that is. Or, perhaps, there is a better way to do this?

标签: oracleoracle-apexoracle-apex-5.1

解决方案


1 - 尝试在这些项目更改时创建动态操作(P1_HIDDEN、P1_DD1、P1_DD2)。

2 - 客户端条件 >> Javascript 表达式

((apex.item('P1_DD1').getValue() != '') &&
(apex.item('P1_DD2').getValue() != '') &&
(apex.item('P1_HIDDEN').getValue() == 'YES'))
||
((apex.item('P1_DD1').getValue() != '') &&
(apex.item('P1_HIDDEN').getValue() == 'NO'))

3 - 真正的行动>>显示你的按钮>>在页面加载时启用执行

4 - 错误操作>>隐藏您的按钮>>在页面加载时启用执行


推荐阅读