Binding to CSS classes in XML views through the "class" attribute is not directly supported by UI5. However, a workaround using custom data can be implemented:
Add custom data to your control, setting the writeToDom property and binding it to the desired expression:
Define a CSS selector that targets the control based on the custom data value. For example:
.myApp .sapText.myControl[data-green] { /* ... */ }
In the following example, the "green" class is added to the
.myApp .sapText.myControl[data-green] { color: green; }
.myApp .sapText.myControl[data-red] { color: red; }
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3