I started a new thread to continue this issue because I had gotten past the 'Unknown Property' error with the handlers. I wanted the new thread to be more specific to the problem, which has evolved into DataGrid not populating from XMLListCollection and namespace issues.
Here's the new thread: http://tech.groups.yahoo.com/group/flexcoders/message/93492 The 'OrdMedList' node is there in the original post. But a quick answer to your question, here's what the structure looks like, w/out the namespaces: <OrdMedList> <OrdMed> <id>5</id> <desc>tylenol</desc> </OrdMed> <OrdMed> <id>97</id> <desc>advil</desc> </OrdMed> ... </OrdMedList> This is the output of the trace() on my XMLListCollection. I also implemented a labelFunction to try to deal with the namespace issue, and found a weird result: there are 10 OrdMed nodes in my list, but the length of OrdMedList is 1 and the labelFunction is invoked 4 times, 2 each for id and desc. --- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > What does an "OrdMedList" node look like? Are id and desc first > generation child nodes? Or attributes? > > > > Also in the hanlder, to check your dataprovider expression, do: > > trace(ordMedList.length) > > Tracy > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Brian > Sent: Monday, November 12, 2007 11:25 AM > To: [email protected] > Subject: [flexcoders] Re: DataGrid not populating from WebService, > error: Unknown Property > > > > 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 > <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 > <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 > <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 [email protected] <mailto:flexcoders%40yahoogroups.com> > , "Tracy Spratt" <tspratt@> 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: [email protected] <mailto:flexcoders%40yahoogroups.com> > [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> > ] On > > Behalf Of Brian > > Sent: Friday, November 09, 2007 3:40 PM > > To: [email protected] <mailto:flexcoders%40yahoogroups.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 > <http://www.adobe.com/2006/actionscrip> > > t/flash/proxy::getProperty > > <http://www.adobe.com/2006/actionscript/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> > > <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> > > <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/> > > <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/> > > <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> > > <http://services.project.company.com > <http://services.project.company.com> > "> > > <desc xmlns="http://services.project.company.com > <http://services.project.company.com> > > <http://services.project.company.com > <http://services.project.company.com> > ">Tylenol</desc> > > <id xmlns="http://services.project.company.com > <http://services.project.company.com> > > <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> > > <http://services.project.company.com > <http://services.project.company.com> > "> > > <desc > > xmlns="http://services.project.company.com > <http://services.project.company.com> > > <http://services.project.company.com > <http://services.project.company.com> > ">Acetaminophen</desc> > > <id xmlns="http://services.project.company.com > <http://services.project.company.com> > > <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> > > <http://services.project.company.com > <http://services.project.company.com> > "> > > <desc xmlns="http://services.project.company.com > <http://services.project.company.com> > > <http://services.project.company.com > <http://services.project.company.com> > ">Advil</desc> > > <id xmlns="http://services.project.company.com > <http://services.project.company.com> > > <http://services.project.company.com > <http://services.project.company.com> > ">7613</id> > > </ns2:OrdMed> > > </OrdMedList> > > </ns1:searchStartsWithResponse> > > </soap:Body> > > </soap:Envelope> > > >

