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:XMLListCollection;
                                                
                        private function submit():void
                                {
                                        EmployeeWS.GetAllEmployees();
                                }
                        
                        private function resultHandler(event:ResultEvent):void
                                {                                               
                                
                                        var xmlResult:XMLList =  new 
XMLList(event.result);
                                        var Employees:XMLListCollection = new 
XMLListCollection(xmlResult.children());
                                        trace(Employees);                       
                                                
                                }


Here is how the trace returns the XMLListCollection data:

<datas6:Employee xmlns:datas6="DM" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
  <datas6:EmployeeID>3</datas6:EmployeeID>
  <datas6:EmployeeLastName>Badham</datas6:EmployeeLastName>
  <datas6:EmployeeFirstName>John</datas6:EmployeeFirstName>
  <datas6:EmployeeMiddleName>C.</datas6:EmployeeMiddleName>
  <datas6:PositionTitle>Data Manager</datas6:PositionTitle>
</datas6:Employee>
<datas6:Employee xmlns:datas6="DM" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
  <datas6:EmployeeID>4</datas6:EmployeeID>
  <datas6:EmployeeLastName>Bui</datas6:EmployeeLastName>
  <datas6:EmployeeFirstName>Tai</datas6:EmployeeFirstName>
  <datas6:EmployeeMiddleName>Tan</datas6:EmployeeMiddleName>
  <datas6:PositionTitle>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="EmployeeLastName"/>
                                <mx:DataGridColumn headerText="First Name" 
dataField="EmployeeFirstName"/>
                                <mx:DataGridColumn headerText="Position" 
dataField="PositionTitle"/>
                        </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