我请求一些带有HTTP服务的XML,如下所示:
<s:HTTPService id="flickrCall" url="{api_request}" resultFormat="e4x" result="Alert.show('Success');" fault="Alert.show('error');"/>
<rsp stat="ok">
<photos page="1" pages="46" perpage="100" total="4501">
<photo id="7583616364" owner="92677738@N00" secret="17ce853221" server="8421" farm="9" title="Jack White iii" ispublic="1" isfriend="0" isfamily="0"/>
<photo id="7515807120" owner="47494725@N07" secret="66fcf2cfd5" server="7137" farm="8" title=".- / -.. ..- -.. . / .- - / .- .--. .--. .-.. . -... . . ..." ispublic="1" isfriend="0" isfamily="0"/>
<photo id="7465794324" owner="73420073@N07" secret="dd42ea30f0" server="7254" farm="8" title="Project 366 175: June 24th" ispublic="1" isfriend="0" isfamily="0"/>
...
</photos>
</rsp>
我尝试将它绑定到这样的数据网格:
<s:DataGrid id="flickrFotoCollection" width="100%" dataProvider="{flickrCall.lastResult.photo}">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="@id"/>
<s:GridColumn dataField="@title"/>
<s:GridColumn dataField="@owner"/>
</s:ArrayList>
</s:columns>
</s:DataGrid>
但即使请求已成功完成,也没有任何显示。
答案 0 :(得分:1)
dataProvider应该是XMLListCollection,如下所示:
<s:DataGrid dataProvider="{ new XMLListCollection(flickrCall.lastResult.photos.photo)}">
答案 1 :(得分:0)
怎么样:
dataProvider="{flickrCall.lastResult.photos}"
这应该向网格发送一个&lt; photo&gt;的数组。标签