Skip to Content
avatar image
Former Member

SWITCH component of sap design studio

Hello,

I want use switch component of sap design studio,but no way to set show content in it's property only ON/OFF.I want show AR/TTL,so I just use css to change the content,I'm successed.But the problem is that it just worked in firefox browser as picture first,and IE or 360 browser false as picture second.Follow is my css code.Does anyone know why?

span[class="sapMSwtLabel sapMSwtLabelOn"]{
 visibility:hidden; 
}
span[class="sapMSwtLabel sapMSwtLabelOn"]:before{
visibility: visible !important;
content: "AR" !important;
}
span[class="sapMSwtLabel sapMSwtLabelOff"]{
visibility:hidden;
} 
span[class="sapMSwtLabel sapMSwtLabelOff"]:before{
visibility: visible !important;
content: "TTL" !important;
}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 09, 2016 at 09:01 AM

    Hi Jing,

    I played with the css selectors a little. There seems to be a problem with your pseudo elements approach (css ::before statement) and IE. This what I came up with to support all browsers. Please assign class "test" to your switch component on its Design Studio properties.

    div[class="test"] span[class*="sapMSwtLabelOff"]{
    	visibility:hidden;
    }
    
    
    .test span[class*="sapMSwtLabelOff"]::before{
    	visibility: visible !important;
    	content: "TTL" !important;
    }
    

    Let us know if that works for you.

    Kind regards

    Martin

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jing,

      Sorry I looked at it the wrong way. You can still try to find a different css selection to achieve what you want. That was the angle I was tyring. But this IE behavior looks suspiciously like a bug I'd say.

      Kind regards

      Martin

  • avatar image
    Former Member
    Dec 09, 2016 at 11:39 AM

    HI Martin,

    did DIV supports in design studio?

    as far as i know we cant play with HTML right

    and i am using design studio 1.6 sp1 i dont see any switch component its a new component ?

    Please correct me if i am wrong

    Thanks,

    Varun

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 15, 2017 at 02:41 PM

    hi Jing,

    what feature did you use as 'switch' button . I am in DS 1.6, and did not find it.

    Add comment
    10|10000 characters needed characters exceeded