We have a textInputBean in our customized OAF page, which is a USD currency column, so we use textInputBeanXXX.setAttributeValue(CURRENCY_CODE,"USD") to format it in the controller. We also need to color this column for certain cases, we call textInputBeanXXX.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, colorStyleSelectorXXX) for the second purpose. The later setAttributeValue call works as expected without the former one. Also no matter the first call is placed before or after the second call, whenever CURRENCY_CODE format attribute is set, the color attribute set through STYLE_CLASS_ATTR is not working any more
This textInputBean has to display in currency number format all the time. Then you mean use switcher to color the textInputBean for different cases? But there is no 'backgroud color' property for the textInputBean, if go by "CSS Class" property, that's actually going to be the same as setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR ...
By the way, is there any other way to display a number item by CURRENCY format other than call setAttributeValue(CURRENCY_CODE,"USD") in controller?
In the Controller while loading the page use
String s4 = Double.toString(d);
to convert it in to desired format, just for displaying, while form submitting again convert the string value back to number and post it to the DB.
Hope it helps!