开发者

Displaying list containing XMLListCollection

I'm a Flex noob and I've been struggling with this problem for a last week, and I'm at my wits end.

I have opened the following XML file

<root>
<person>
<city-of-death>asdf</city-of-death>
<place-of-death>qwert</place-of-death>
</person>
<person>
<city-of-death>hjkl</city-of-death>
<place-of-death>yuio</place-of-death>
</person>
</root>

Using the following code

[Bindable]
            private var people:XMLListCollection;
private function resultHandler(event:ResultEvent):void {
                people = new XMLListCollection(event.result.person);
            }

and am trying to display it using for following mxml

<s:List left="0" height="94" dataProvider="{people}" labelField="@city-of-death" width="144" y="-1"></s:List>

Essentially, I'm hoping to have a list displaying ... but there is nothing displayed

asdf
hjkl
开发者_如何学JAVA

I would be so incredibly grateful if someone could help. I am pulling out my hair!


@ sign is for attributes. Try to use something like:

<s:List left="0" height="94" dataProvider="{people}" labelField="city-of-death" width="144" y="-1"></s:List>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜