Dynamically Switch Theme on change Module
1.) Create an Application Item with name MODULE_TYPE
2.) Create an Application Process e.g. SET_THEME_STYLE at point On Load: Before Header
DECLARE
l_current_theme_number number;
l_new_theme_style_id number;
l_current_theme_number number;
l_new_theme_style_id number;
BEGIN
select theme_number
into l_current_theme_number
from apex_application_themes
where application_id = :app_id
and ui_type_name = ‘DESKTOP’
and is_current = ‘Yes’;
into l_current_theme_number
from apex_application_themes
where application_id = :app_id
and ui_type_name = ‘DESKTOP’
and is_current = ‘Yes’;
if :MODULE_TYPE is not null
then
if :MODULE_TYPE = ‘KARIANA’
then
then
if :MODULE_TYPE = ‘KARIANA’
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita’
);
p_theme_number => l_current_theme_number,
p_name => ‘Vita’
);
elsif :MODULE_TYPE = ‘FOOD’
then
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Dark’
);
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Dark’
);
elsif :MODULE_TYPE = ‘MEDICAL’
then
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Red’
);
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Red’
);
elsif :MODULE_TYPE = ‘AGRICULTURE’
then
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Slate’
);
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Slate’
);
end if;
end if;
end if;
end;
3.) Set the Module name in SET_THEME_STYLE on change module of the application
Comments
Post a Comment