Custom Renderer

Using SmartGWT 2.4 and IE7.

I am trying to change the background color of a TextItem once the FormItem houses a value that is out-of-range (sort of like a cell renderer for Grids).

For example, given a very simple TextItem

TextItem ti = new TextItem();

I want to be able to change the background of the item, during runtime, depending on the following criteria:

1-10: red
11-20: yellow
21+: green

The value is retrieved from a database and set into the TextItem. I’m looking for a more efficient way than checking the value on fetch and setting various CSS styles on the TextItem.

Does such a functionality exist?

Any help is appreciated.