You have a namespace issue.

 

You might be able to use the namespace in the dataField, like this:

dataField="datas6::Employee LastName", but I am not sure that will work.

 

But I would declare a namespace and use that.  I don't have any code handy,
but search for namespace and you will find examples and more info.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Angelo Anolin
Sent: Sunday, October 25, 2009 11:27 AM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [flexcoders] Can't bind XMLListCollection to Datagrid

 

  

Could you try this one in your resultHandler....



private function resultHandler( event:ResultEven t):void
{
var xmlResult:XML = XML(event. result);
var Employees:XMLListCollection = new XMLListCollection( xmlResult.table(
));
trace(Employees) ;
}



 

  _____  

From: jc_bad28 <jc_ba...@yahoo.com>
To: flexcoders@yahoogroups.com
Sent: Sunday, 25 October, 2009 13:30:24
Subject: [flexcoders] Can't bind XMLListCollection to Datagrid

  

I changed my webservice call to return e4x but I can't get the
XMLListCollection to bind to the datagrid.

Here is the pertinent AS code:

[Bindable]
private var Employees:XMLListCo llection;

private function submit():void
{
EmployeeWS.GetAllEm ployees() ;
}

private function resultHandler( event:ResultEven t):void
{ 
var xmlResult:XMLList = new XMLList(event. result);
var Employees:XMLListCo llection = new XMLListCollection( xmlResult.
children( ));
trace(Employees) ; 
}

Here is how the trace returns the XMLListCollection data:

<datas6:Employee xmlns:datas6= "DM" xmlns:soapenv= "http://schemas.
<http://schemas.xmlsoap.org/soap/envelope/>  xmlsoap.org/ soap/envelope/">
<datas6:EmployeeID> 3</datas6: EmployeeID>
<datas6:EmployeeLas tName>Badham< /datas6:Employee LastName>
<datas6:EmployeeFir stName>John< /datas6:Employee FirstName>
<datas6:EmployeeMid dleName>C. </datas6: EmployeeMiddleNa me>
<datas6:PositionTit le>Data Manager</datas6: PositionTitle>
</datas6:Employee>
<datas6:Employee xmlns:datas6= "DM" xmlns:soapenv= "http://schemas.
<http://schemas.xmlsoap.org/soap/envelope/>  xmlsoap.org/ soap/envelope/">
<datas6:EmployeeID> 4</datas6: EmployeeID>
<datas6:EmployeeLas tName>Bui< /datas6:Employee LastName>
<datas6:EmployeeFir stName>Tai< /datas6:Employee FirstName>
<datas6:EmployeeMid dleName>Tan< /datas6:Employee MiddleName>
<datas6:PositionTit le>Inserter Operator</datas6: PositionTitle>
</datas6:Employee>

Here is the datagrid code:

<mx:DataGrid id="myGrid" dataProvider= "{Employees} " height="272" y="10"
width="603" x="167" borderStyle= "outset">
<mx:columns>
<mx:DataGridColumn headerText=" Last Name" dataField="Employee LastName" />
<mx:DataGridColumn headerText=" First Name" dataField="Employee FirstName"
/>
<mx:DataGridColumn headerText=" Position" dataField="Position Title"/>
</mx:columns>
</mx:DataGrid>

I've been spinning my wheels with this for 2 weeks now. It's probably
something simple, but I can't figure it out after googling non-stop every
damn day. Any help is greatly appreciated.

 



Reply via email to