I have a table where one of the columns (sap.m.Text
) represents a binary value (0
/1
) and I would like to format it in the following manner:
- Mapping:
0
/1
→No
/Yes
- Style:
No
should be a red color - Style:
Yes
should be a green color
The mapping I've performed as described in Step 23: Custom Formatters, everything is working correctly.
But I'm struggling with style-formatting. In the Step 22: Expression Binding there is an example how to format a number according to its value by using the numberState
, however, sap.m.Text
(<Text />
) doesn't have such or any similar property.
Is there any easy way to apply a style formatting based on a value for sap.m.Text
? Or the only way is to apply manually a CSS-style?