Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 02 at 02:17 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

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

    Hi ,

    check below example

    https://github.com/memeghal1990/changecss

    Regards,

    Meghal Shah

    Add comment
    10|10000 characters needed characters exceeded