Oracle APEX: How to Programmatically Switch Tabs using jQuery

There is no predefined Dynamic Action for switching tabs in Oracle APEX. Therefore, we need to use jQuery to identify the tab and the click() method to simulate the click.
The code below simulates a click on 2nd tab and opens it.
$('#myRegion li.t-Tabs-item:eq(1) a').click();
#myRegionis the static ID of the specific tab region which can be defined at » Right pane of your tab region » Advanced » Static IDWe have put
:eq(1)to acces 2nd tab because, indexing in JavaScript starts with0and the 1st item (tab) is at index 0, 2nd tab is at index 1 and so on….
How to use this?
You can use this script to switch to a specific tab automatically based on user actions like:
Click on a URL.
<a href="#" onClick="$('#myRegion li.t-Tabs-item:eq(1) a').click(); return false;"> Click Here </a>Click on a Button.
Create a Dynamic Action with action type
Execute JavaScript Codeand use the same JS code there.Click on a link or buttion attached to an event listner or any other custom code..
Check this post if you are interested to know how to create and use Event listeners Oracle APEX.




