on 11-06-2014 1:23 PM
Hello,
I have implemented the functionality of setting the background color for the sap.m.button on button click event by adding the style class to the button.
Recently we have upgraded the HANA to SP08 latest revision. After that I noticed that SAP UI5 library is in 1.22.9 version. The background color for the button is not set properly now. It is partially visible only on the top and bottom of the button.
I inspected the button element and found that one another inner div element is added to the button.
The code in the button element of the older version as follows
<button type="button" id="B1SB" data-sap-ui="B1SB" tabindex="0" class="sapMBtn sapMBtnDefault sapMBtnDesktop sapMBtnPaddingLeft sapMBtnPaddingRight sapMFocusable" >
<span class="sapMBtnContent">Hello</span>
</button>
The code in the button element of the newer version as follows
<button type="button" id="B1SB" data-sap-ui="B1SB" class="deselected sapMBtn">
<div id="B1SB-inner" class="sapMBtnDefault sapMBtnHoverable sapMBtnInner sapMBtnPaddingLeft sapMBtnPaddingRight sapMFocusable">
<span class="sapMBtnContent" id="B1SB-content">Hello</span>
</div>
</button>
I am not sure whether this has some relation to the improper rendering.
Kindly help me out to resolve this issue.
Thanks & Regards,
Monissha
I am not sure whether this has some relation to the improper rendering.
Possibly not! I remember as if i read "UI5 team doesn't guarantee you the dom structure or class names used internally to be same across all the versions". So it may vary a bit when enhances are done on controls.
I just gave a try to make it compatible with both versions of the dom you had mentioned, check it out running this snippet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Monissha,
Add important property to CSS value for example
Deselected:{background-color: black !important}
Thanks and Regards,Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Venkatesh,
I have implemented using important only. Even then it does not work properly.
The following is my CSS code
.selected {
background-color: #007cc0 !important;
color: #FFFFFF !important;
}
.deselected {
background-color: #f7f7f7 !important;
color: #000000 !important;
}
Thanks
Monissha
HI Monissha
I suggest that you add a style class and override the sapui5 style class like this.
Thanks
-D
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.