tags:

views:

109

answers:

2

I want to fill color based on condition so I used conditional operator for the checkbox. But it's shows the error Implicit coercion of a value of type String to an unrelated type Array. What did I do wrong ? How can I dynamically change the color of a checkbox ?

<mx:CheckBox id="home" enabled="false"  fillColors="{(data.actualwin != '1') ? 
    '[#8CE912,#8CE912]' : '[#8CE912,#8CE912]'}"  selected="{data.betting_home=='1'}"/>
+1  A: 

Try replacing

'[#8CE912,#8CE912]'

with

["#8CE912","#8CE912"]

or

[0x8CE912,0x8CE912]

(remove quotes)

You pass a string ('[#8CE912,#8CE912]') into a property where an array is expected

artemb
thanks artemb . i found the problemfillColors="{[(data.actualwin == '2') ?'#66ff00' : '#ffffff']}"
R.Vijayakumar
A: 

Or you can use an ItemRenderer

mazgalici