Initializer for ‘dataProvider’: values of type mx.collections.IList cannot be represented in text.
Initializer for 'dataProvider': values of type mx.collections.IList cannot be represented in text.
Problem
The problem is we are not enclosing the reference to array collection with curly braces. The list component thinks that we are passing a string. So changing from "myData" to "{myData}".
Incorrect code:
XML:
-
<fx:Declarations>
-
-
<s:ArrayCollection id="myData">
-
<s:source>
-
<fx:Object label="Engineering" data="ENG"/>
-
<fx:Object label="Product Management" data="PM"/>
-
<fx:Object label="Marketing" data="MKT"/>
-
</s:source>
-
</s:ArrayCollection>
-
</fx:Declarations>
-
-
<s:List dataProvider="myData" x="10" y="10" width="575" height="297" skinClass="ActivityStreamSkin"></s:List>
Solution
XML:
-
<s:List dataProvider="{myData}" x="10" y="10" width="575" height="297" skinClass="ActivityStreamSkin"></s:List>
Please post your comments to help future visitors.
No comments yet. Be the first.
Leave a reply
Wrap MXML and ActionScript in [xml] [/xml] and [as] [/as] tags respectively