macwadu
macwadu

Reputation: 907

Create a page process to hide a region

I'm having some problems creating a process to hide a region in pl/sql. Can anyone give a example of how to do it?

Tanks.

Upvotes: 0

Views: 4508

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132570

If appropriate, you can put the PL/SQL you need directly into the Condition, using the Condition Type "PL/SQL Function Body Returning a Boolean". For example (using your code from above, which doesn't seem quite right to me - all roads lead to hidden=3!):

DECLARE 
 a NUMBER;
 b NUMBER;
 hidden NUMBER;
BEGIN
 select count(1) into a from TN_HISTORY_ITEMID where itemid in (select id from TN_TREE where pid = (select id from tn_tree where pid =:P1_ID));
 select count(1) into b from surv_host_data where id_client = :P1_ID;
 if b <> 0 AND a = 0 then hidden := 3;
 elsif a = 0 then hidden := 3;
 elsif b = 0 then hidden := 3;
 else hidden := 3;
 end If;

 return (hidden = 3);
End;

If you need to do it with a process and a page item, then you need to make sure that the item is rendered before the region, and that the process runs before the region to be hidden is rendered. Otherwise by the time the item is set it will be too late.

Upvotes: 1

Related Questions