You can try this
- Create a dynamic action for the Page Load event
- Create a true action "Run javaScript code":
window.setTimeout(function(){ $('.a-Region-carouselLink').click(function(){ apex.event.trigger(document, 'tabChanged', this); }) }, 500);
- Set Poster Load to Yes
- Create custom event "tabChanged"
Create a true action in the DA Custom JavaScript Code Execution event:
console.log(this.data);
Test it - every time you click a tab, DA prints to the console at the moment, anchored to the anchor.
Of course, it is not ideal due to a delay of 0.5 s. However, it allows you to listen to which tab was clicked.
To make your work in the script, I would do:
- create page element
PX_TAB - create a valid action in a custom event to set the value of
PX_TAB - create valid actions in a custom event to update reports in tabs
- set "Page Elements to
PX_TAB " to " PX_TAB " in each updated report. - add a condition to each report comparing the value of the
PX_TAB element - it will execute the SQL query only when PX_TAB expects the expected value
edit 08/08/13
You can snap tabs by simply adding a listener to the tabs
$(document).on('mousedown', 'at-Tabs-link', function(){ //this is an anchor used as tab console.log(this) })
If you want to save it on the APEX path, enter the code below in the Execute when Page Loads section or create a new dynamic action On page load
$(document).on('mousedown', 'at-Tabs-link', function(){ apex.event.trigger(document,'tabChanged', this); })
and then add the dynamic action associated with the Custom event named tabChanged . Whenever a tab is clicked, the tabChanged event is fired, and in Execute JavaScript Code you can reference the current tab to this.data
source share