开发者

ArrayCollection of data for label test in flex?

开发者 https://www.devze.com 2023-02-07 02:43 出处:网络
My label text is not showing up after binding the arraycol开发者_Python百科lection to the label text. Could I see an example of how to properly bind an arraycollection to a labels text?I guess I am co

My label text is not showing up after binding the arraycol开发者_Python百科lection to the label text. Could I see an example of how to properly bind an arraycollection to a labels text?


I guess I am confused to what your problem is. When I do it, it prints the ArrayCollection just fine:

<fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;

        var data:ArrayCollection = new ArrayCollection(["1", "2", "3", "4"]);   
    ]]>
</fx:Script>

<s:Label text="{data}" />

prints out: 1,2,3,4

What type of data is in your ArrayCollection? Do you need to define toString() on your data type?


Maybe you shoud try binding to an element of the ArrayCollection? Because binding to the whole ArrayCollection as a text to a label does not make sense. Some code would be useful.

0

精彩评论

暂无评论...
验证码 换一张
取 消