dg2data.children();

 

 

you might wanna look at 

 

http://www.adobe.com/devnet/flex/quickstart/accessing_xml_data/

 

brian..

 

 

 

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of its_llpj
Sent: Thursday, September 06, 2007 11:47 AM
To: [email protected]
Subject: [flexcoders] Re: Populating XMLListCollection and sending it to
a Datagrid

 

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] <mailto:flexcoders%40yahoogroups.com>
, "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:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of its_llpj
> Sent: Thursday, September 06, 2007 12:13 PM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> 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!
>

 



***
The information in this e-mail is confidential and intended solely for the 
individual or entity to whom it is addressed.  If you have received this e-mail 
in error please notify the sender by return e-mail delete this e-mail and 
refrain from any disclosure or action based on the information.
***

Reply via email to