When controlling the css class externally, the css class change only updates the control the first time the property is set. See example.
control starts with no css class. After 5 seconds the error class is applied which will update the control. After 5 more seconds the success class is applied and the control will not be updated.
I'm currently getting around this by calling refresh on the control which caused me to do another hack.