I'll try tracing it, but I did have alerts all around both functions
to make sure things are getting called.

I tried the dg2data.getChildren() within the dataProvider, but I get
an error:

Error: Call to a possibly undefined method getChildren through a
reference with static type mx.collections:XMLListCollection.

        <mx:DataGrid id="dg2" width="100%" height="100%" rowCount="10"
dataProvider="{dg2data.getChildren(name)}">





--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Are you sure onResult is getting called? If so, trace out
> dg2data.toXMLString() to make sure you have what you expect.  You should
> see readable xml.
> 
>  
> 
> Make sure  "name" is a first generation child node name in the item
> node.
> 
>  
> 
> Tracy 
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of its_llpj
> Sent: Thursday, September 06, 2007 12:13 PM
> To: [email protected]
> Subject: [flexcoders] Populating XMLListCollection and sending it to a
> Datagrid
> 
>  
> 
> Hello, I'm trying to populate a datagrid. Here is my code. Everything
> works, but when I use the dataProvider dg2data within my datagrid it
> comes back empty. I know there is data there, but not sure if I'm
> missing something.
> 
> public function onSelectFirstGrid(event:Event):void
> 
> {
> myRequest.addEventListener(Event.COMPLETE, onResult)
> myRequest.send(dg.selectedItem.myID);
> }
> 
> private function onResult(e:ResultEvent):void
> 
> {
> dg2data = e.result as XMLListCollection;
> }
> 
> private function onFault(e:FaultEvent):void
> 
> {
> Alert.show(e.fault.message, "Could not load");
> }
> 
> [Bindable]
> public var dg2data: XMLListCollection;
> 
> My DataGrid
> <mx:DataGrid id="dg2" width="100%" height="100%" rowCount="10"
> dataProvider="{dg2data}">
> <mx:columns>
> <mx:DataGridColumn dataField="name" headerText="Name" />
> </mx:columns>
> </mx:DataGrid>
> 
> Thanks!
>


Reply via email to