Oracle APEX - switching Region Display Selector regions from a link item

1.2k views Asked by At

I have a couple of classic report columns that are links and a region display selector with a couple of regions under it. How can I switch between RDS regions dynamically when a corresponding column link is clicked?

I tried setting link type to URL and set it to

apex.region("RDS").widget().aTabs("getTabs")["#MY_TAB_STATIC_ID"].makeActive();

But that did not work - APEX tried to go to a different page.

1

There are 1 answers

3
Koen Lostrie On

Here is one option. I didn't use page items but you'll probably be able to reuse the logic:

  • Create 2 regions, give them static id rdsregion-1 and rdsregion-2
  • Create a display selector
  • Create a static report with the following sql:
select EMPNO,
       ENAME,
       JOB,
       MGR,
       HIREDATE,
       SAL,
       COMM,
       DEPTNO , 
       CASE WHEN SAL > 2500 THEN '<div class="setrds1">set rds 1</div>' ELSE '<div class="setrds2">set rds 2</div>' END as rds
  from EMP
  • Create a dynamic action named "Set RDS1"

    • Event: Click
    • Selection Type: jQuery Selector
    • jQuery Selector: .setrds1
  • add a true action to DA "Set RDS1" o

    • Action "Execute Javascript Code"
    • Javascript code:
$('#rdsregion-1_tab a').trigger("click");
  • Create a similar dynamic action for RDS2.

Note that both snippets work:

$('a[href="#rdsregion-1"]').trigger("click");

and

$('#rdsregion-1_tab a').trigger("click");