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;
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’;
if :MODULE_TYPE is not null
then
if :MODULE_TYPE = ‘KARIANA’
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita’
);

elsif :MODULE_TYPE = ‘FOOD’
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Dark’
);
elsif :MODULE_TYPE = ‘MEDICAL’
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Red’
);
elsif :MODULE_TYPE = ‘AGRICULTURE’
then
apex_theme.set_session_style (
p_theme_number => l_current_theme_number,
p_name => ‘Vita – Slate’
);

end if;
end if;
end;
3.) Set the Module name in SET_THEME_STYLE  on change module of the application

Comments

Popular posts from this blog

Parsing json using webservice url

Load image in base64 formate in database column from directory reference filename stored in table