OK I've changed the resultFormat to "e4x" and added a result handler.
With trace I'm able to see the result coming back. I tried using a
namespace variable also after further searching here, but I'm still
confused about how that works. The error is gone, but I'm still not
getting any results in the datagrid. I'm assuming I'm missing
something with the dataProvider expression and/or handling of the
XMLList and Collection. 

Here's my current mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">

        <mx:Script>
                <![CDATA[
                        import mx.collections.XMLListCollection;
                        import mx.controls.Alert;
                        import mx.rpc.events.ResultEvent;
                        private namespace ovServices = 
"http://services.project.company.com";;
                        use namespace ovServices;
                        [Bindable]
                        public var ordMedList:XMLListCollection;
                        public var ordMedXMLList:XMLList;
                        
                        public function 
handleOrdMedSearch(event:ResultEvent):void {
                                trace("handling OrdMedSearchResult");
                                var resultXML:XML = XML(event.result);
                                ordMedXMLList = resultXML.child("OrdMedList");
                                //trace("ordMedList : " + ordMedList);
                                ordMedList = new XMLListCollection();
                                ordMedList.source = ordMedXMLList;
                        }
                ]]>
        </mx:Script>
        
        <mx:WebService id="ordMedSearchWS"
                
wsdl="http://localhost:8080/OrderViewWeb/services/OrderableMed?wsdl";
                showBusyCursor="true">
                <mx:operation name="searchStartsWith" resultFormat="e4x"
result="handleOrdMedSearch(event)">
                        <mx:request>
                                <searchText>{ordMedSearchText.text}</searchText>
                        </mx:request>
                </mx:operation>
        </mx:WebService>
                
        <mx:HBox x="10" y="70">
                        <mx:Label text="Orderable Med Search" />
                        <mx:TextInput id="ordMedSearchText" width="100"/>
                        <mx:Button label="Search"
click="ordMedSearchWS.searchStartsWith.send()"/>
                        <mx:Label />
        </mx:HBox>
        
        <mx:DataGrid x="10" y="100" id="ordMeds" width="400"
dataProvider="{ordMedList}">
                        <mx:columns>
                                <mx:DataGridColumn headerText="Id" 
dataField="id" width="100"/>
                                <mx:DataGridColumn headerText="Desc" 
dataField="desc" />
                        </mx:columns>
        </mx:DataGrid>
                
</mx:Application>



--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Use trace() to display the xml content you are getting back from the
> WebService, so you can see exactly how to build the dataProvider
> expression... oops, you can't, because you are binding to lastResult.
> Consider using a result handler instead..
> 
>  
> 
> Also, specify resultFormat="e4x".  The default converts your xml to a
> nested object structure of some sort.
> 
>  
> 
> Tracy
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Brian
> Sent: Friday, November 09, 2007 3:40 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] DataGrid not populating from WebService, error:
> Unknown Property
> 
>  
> 
> OK I'm back with my next WebService question. I got one working when
> there was only one object coming back. Now I'm trying to populate a
> DataGrid with the lastResult from a WebService and I'm getting an
> Unknown Property error. I've searched for this here and am wondering
> if I either need a [] somewhere in the dataProvider or I need to put
> the result into an ArrayCollection first and then set the dataProvider
> to that. Or could it be that the OrdMedList element doesn't have a
> namespace like all the other elements? That's due to a weird issue
> with CXF and JAX-WS.
> 
> Here's the error: 
> 
> Error: Unknown Property: 'OrdMedList'.
> at
> mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscrip
> t/flash/proxy::getProperty
> <http://www.adobe.com/2006/actionscript/flash/proxy::getProperty> ()
> 
> Here's my mxml:
> 
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
> layout="absolute">
> <mx:WebService id="ordMedSearchWS"
> wsdl="http://localhost:8080/OrderWeb/services/OrdMed?wsdl
> <http://localhost:8080/OrderWeb/services/OrdMed?wsdl> "
> showBusyCursor="true">
> <mx:operation name="searchStartsWith">
> <mx:request>
> <searchText>{ordMedSearchText.text}</searchText>
> </mx:request>
> </mx:operation>
> </mx:WebService>
> <mx:HBox x="10" y="70">
> <mx:Label text="OrdMed Search" />
> <mx:TextInput id="ordMedSearchText" width="100" />
> <mx:Button label="Search"
> click="ordMedSearchWS.searchStartsWith.send()" />
> <mx:Label />
> </mx:HBox>
> <mx:DataGrid x="10" y="100" id="ordMeds" width="400"
> dataProvider="{ordMedSearchWS.searchStartsWith.lastResult.OrdMedList.Ord
> Med}">
> <mx:columns>
> <mx:DataGridColumn headerText="Id" dataField="id" />
> <mx:DataGridColumn headerText="Desc" dataField="desc" width="150" />
> </mx:columns>
> </mx:DataGrid>
> </mx:Application>
> 
> Here's my WebService response:
> 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
> <http://schemas.xmlsoap.org/soap/envelope/> ">
> <soap:Body>
> <ns1:searchStartsWithResponse
> xmlns:ns1="http://services.project.company.com/
> <http://services.project.company.com/> ">
> <OrdMedList>
> <ns2:OrdMed xmlns:ns2="http://services.project.company.com
> <http://services.project.company.com> ">
> <desc xmlns="http://services.project.company.com
> <http://services.project.company.com> ">Tylenol</desc>
> <id xmlns="http://services.project.company.com
> <http://services.project.company.com> ">7611</id>
> </ns2:OrdMed>
> <ns2:OrdMed xmlns:ns2="http://services.project.company.com
> <http://services.project.company.com> ">
> <desc
> xmlns="http://services.project.company.com
> <http://services.project.company.com> ">Acetaminophen</desc>
> <id xmlns="http://services.project.company.com
> <http://services.project.company.com> ">7612</id>
> </ns2:OrdMed>
> <ns2:OrdMed xmlns:ns2="http://services.project.company.com
> <http://services.project.company.com> ">
> <desc xmlns="http://services.project.company.com
> <http://services.project.company.com> ">Advil</desc>
> <id xmlns="http://services.project.company.com
> <http://services.project.company.com> ">7613</id>
> </ns2:OrdMed>
> </OrdMedList>
> </ns1:searchStartsWithResponse>
> </soap:Body>
> </soap:Envelope>
>


Reply via email to