Skip to Content
0

Hi I want to know how to use different css file in controller in sapui5?

Apr 02 at 11:59 AM

43

avatar image
Former Member

Hi

I am working on SAPUI5. I have one button and two radio button in xml view. I have tow CSS file. In one CSS file, background color of button is red and in another is green. I have two radio button. If I click on first radio button, background color of button should changed to red. And on press of another radio button the color should change to green. Is it possible? How to do this? please help me.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Akhilesh Upadhyay Apr 02 at 02:17 PM
1

Hi,

you can accoplish this by using one css file as well, btw you can add as many css files with ',' seperated in component.js file inside metadata as below,

metadata: {
"includes": ["css/style.css",.....]
},

and on radio button select you can use addStyleClass() method to assign new class to the button.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you. Understood.

0

Welcome! pls mark as accepted if your issue has been resolved by above input.

0
avatar image
Former Member Apr 02 at 03:37 PM
0

Hi ,

check below example

https://github.com/memeghal1990/changecss

Regards,

Meghal Shah

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Please mark as correct answer if your issue has been resolved.

0