显示包含 XMLListCollection 的列表

发布于 2024-11-10 09:18:30 字数 906 浏览 8 评论 0原文

我是一名 Flex 菜鸟,上周我一直在与这个问题作斗争,现在我已经束手无策了。

打开了以下 XML 文件

<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>

我已经使用以下代码

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

,并尝试使用以下 mxml 显示它

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

本质上,我希望有一个显示列表...但没有显示任何内容,

asdf
hjkl

如果有人可以提供帮助,我将非常感激。我要拔掉我的头发!

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空袭的梦i 2024-11-17 09:18:30

@ 符号用于属性。尝试使用类似的东西:

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

@ 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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文