Thanks for all your help. Doug, your idea gave me a different idea of
something to try which seems to work
<mx:Model id="listData">
{listService.lastResult.things}
</mx:Model>
<mx:List
id="list"
dataProvider="{listData.thing}"
labelField="name" />
I still don't understand why that works and what I previously had
doesn't, because you are referencing exactly the same object (i.e. an
array) but in a different way. I guess it's all to do with the crazy
Model...
--- In [email protected], "Doug Lowder" <[EMAIL PROTECTED]> wrote:
>
> It seems to me that you need to specify a property of the model as
> the list's dataprovider, instead of using the model itself. I
> haven't tested this, but I'd be curious to see what happens if you
> try the following changes:
>
> <mx:Model id="listData">
> <things>{listService.lastResult.things.thing}</things>
> </mx:Model>
>
> <mx:List
> id="list"
> dataProvider="{listData.things}"
> labelField="name" />
>
>
> --- In [email protected], "g_odds" <g_odds@> wrote:
> >
> > I am attempting to populate a List from Model filled by the result
> of
> > an HTTPService. However, the list only shows one entry as "[object
> > Object], [object Object],..". As far as I am aware that is the
> result
> > of a toString() on a collection. But why is the List not using that
> > collection to populate itself properly (as I want it to, hehe).
> >
> > Thanks in advance for any help.
> >
> > Graham
> >
> >
> > The code:
> >
> > ...
> > <mx:HTTPService
> > id="listService"
> > url="..."
> > />
> > <mx:Model id="listData">
> > {listService.lastResult.things.thing}
> > </mx:Model>
> > <mx:List
> > id="list"
> > dataProvider="{listData}"
> > labelField="name"
> > />
> > ...
> >
> >
> > and the XML that results from the HTTPService send:
> >
> > <things>
> > <thing>
> > <name>MyName</name>
> > <value>MyValue</value>
> > <thing>
> > ...
> > <things>
> >
>