A while aback I had a puzzle with setting the visibility of certain tabs on a carousel region. Whether a tab displays or not depends on user selections on another page; based on those selections, I can hide or show a particular tab of the carousel. The problem was, firing my hide/show dynamic action after Page Load was not doing it – the carousel seemed to complete its rendering after Page Load. What?
I went to apex.world for suggestions. The solution was to fire my hide/show DA on the theme42ready event.
This event fires after page load … which is the event I needed.
How would I know such an event exists?
Luckily a friend in apex.word – Thank You Jeff Eberhard – clued me in.
theme42ready
is triggered after the initialization of Universal Theme:
jQuery(window).on('theme42ready', function() {
log('Do something after UI elements are rendered on the page.');
});
I was then able to implement a dynamic action that first on event theme42ready – and got the result I expected.
There are two other Universal Theme events one should be aware of that may help in similar situations:
theme42layoutchanged
is triggered when left navigation menu is expanded or collapsed.
apex.jQuery("#t_TreeNav").on('theme42layoutchanged', function(event, obj) {
console.log('Left menu action: ' + obj.action); // obj.action will return expand or collapse
});
and
apexwindowresized
is triggered when the APEX window is resized
apex.jQuery(window).on('apexwindowresized', function() {
console.log('Window resized.');
});
For more information on these events and other aspects of the Universal Theme, see the Universal Theme reference application. https://apex.oracle.com/pls/apex/f?p=42:6200:::NO:::