cancel
Showing results for 
Search instead for 
Did you mean: 

Change sap ui5 theme on click of a button after bootstrap

GeorgeAbraham
Participant
0 Kudos

Hi Experts,

What I am looking for is a way to change the SAP UI5 theme after it has been rendered?

The approach mentioned in the below link is before the bootstrap happens.

https://answers.sap.com/questions/10173073/how-to-add-two-different-themes-in-one-sapui5-appl.html#

Say I want to shift between two themes - Quartz and Belize on click of a button or say even as per the example in the link, if I change my device type to mobile via debugger, I want the theme to change.

In my controller, I have access to window["sap-ui-config"] but changing it is not reflecting in the application? Is there a way to refresh/re-render the application after changing?

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

try this.

sap.ui.getCore().applyTheme("sap_belize_plus");

-Mahesh

GeorgeAbraham
Participant

Thanks a lot maheshkumar.palavalli - this was exactly what I was looking for.

Answers (0)