I suspect this is the issue
filterData.lastResult.filter.item

When working with XML like this, the root node is not needed in the
reference.  Thus it should be
filterData.lastResult.item
I've wasted a couple half-days on this one!

I pasted a working copy below....hopefully it won't get eaten by the
list....if so I attached it.

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

   <mx:Script>
       <![CDATA[
           import mx.rpc.events.ResultEvent;

       [Bindable]
       private var leData:Object;

           private function initMe():void    {
               filterData.send();
           }

           private function xmlResult( event:ResultEvent):void    {
               leData = event.result.item;

           }
       ]]>
   </mx:Script>

   <mx:HTTPService id="filterData"
       url="data.xml"
       result="xmlResult( event )"
       resultFormat="e4x" />
   <mx:DataGrid dataProvider="{leData}">
       <mx:columns>
           <mx:DataGridColumn headerText="Question" dataField="question"/>
           <mx:DataGridColumn headerText="Response" dataField="response"/>
       </mx:columns>
   </mx:DataGrid>


</mx:Application>


On 4/26/07, Clarke Bishop <[EMAIL PROTECTED]> wrote:

I am trying to use XML (e4x format) as a dataProvider.

1. I load the XML via an HTTPService call that is triggered by the
CreationComplete event that calls my init() method.

<mx:HTTPService id="filterData" url="ModelData/FilterData.xml"
result="xmlResult()" resultFormat="e4x" />

2. The XML data comes back. I can see it with the debugger in lastResult.

3. I'm trying to assign the filterData XML to an XMLListCollection like
this:

<mx:XMLListCollection id="xc" source="{filterData.lastResult.filter.item }
"/>

I know the dataGrid is supposed to automatically convert an XMLList to an
XMLListCollection, but since it's not working, I thought I could understand
it better by doing it manually.

The problem is that even though the XML data is there, the
XMLListCollection stays blank. What am I missing?

By the way, here's an example of my external XML file:

<?
xml version="1.0" encoding="UTF-8"?>
<filter>
   <item section="Mission">
      <question>Do you like this color?</question>
      <response>Y</response>
   </item>
</filter>

Thanks for any ideas!

   Clarke

-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------




--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Attachment: index.mxml
Description: Binary data

Reply via email to