Thursday, 15 September 2011

sapui5 - Sap UI 5 css on button -


I was just trying to implement CSS on the button. But it is not working.

  & lt; Core: View Controller Name = "sap.hcm.Address" xmlns = "sap.ui.commons" xmlns: core = "sap.ui.core" xmlns: html = "http://www.w3.org/1999/ Xhtml "& gt; & Lt; HTML: Style & gt; . MySuperRedButton {Color: Red; } & Lt; / Html: style & gt; & Lt; Cell & gt; & Lt; Button class = "mySuperRedButton" text = "press me!" / & Gt; & Lt; / Cell & gt; & Lt; Core: View & gt;  

Reference link:

Many HTML / DOM elements in the button Styles on some of those internal control elements can also be applied. It has actually happened in your case:

  .sapMBtnInner {color: # 333333; }  

Overrides your CSS. You can either remove it using! Important (less-better):

 . MySuperRedButton {color: red! Important; }  

or by referring to the internal square:

 . MySuperRedButton .sapMBtnInner {color: red; }  

If you are more interested in the internal HTML of a control, then you can either check the DOM or the controller renderer class.

BTW: You as a separate file for your css better reuse and a cleaner project structure.

BR Chris


No comments:

Post a Comment