Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 593
Coding Duchess Avatar asked Mar 26 '19 18:03

Coding Duchess


1 Answers

1 - Try to create a dynamic action when these items change (P1_HIDDEN, P1_DD1, P1_DD2).

2 - Client Side Condition >> Javascript Expression

((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 - True Action >> Show your button >> enable execute when page load

4 - False Action >> Hide your button >> enable execute when page load

like image 51
romeuBraga Avatar answered Oct 19 '22 01:10

romeuBraga