views:

322

answers:

1

I have a Spark DropDownList that has a custom ItemRenderer. The ItemRenderer, upon creation, checks the label text and if it matches certain criteria, then the label text color changes. The label text color is changing, however it is for the wrong label. What appears to be happening is that the label color that is actually being changed is in reverse order of how the labels are displayed in the drop down list.

For example, the list contains the text labels: One, Two, Three, Four, and is being displayed in that exact order. I am checking for the label "One" and then changing it's text color. What actually ends up happening is that the text color for "Four" (first item from bottom) is actually being changed. If I check for the text label, "Three", then the text color for "Two" (third item from bottom) gets changed. If I check for the label text "Four", the text color for "One" (fourth item from bottom) gets changes. This functionality seems to hold true for each item in the DropDownList.

Any suggestions on how to resolve this issue so that the correct text color is being changed?

Thanks for the assistance.

A: 

Use dataChange event handler in the itemrenderer and reset the color to the normal label color if it doesn't meet the criteria. If it does meet criteria, then change to the specified color.

AZSL