Is it possible to use conditional operator in checkbox using flex?
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'}"/>
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
Or you can use an ItemRenderer
精彩评论