On the contrary to an earlier response, I believe you need to change

checkJobs.lastResult.jobs.job

to

checkJobs.lastResult.job

It's been a while since I interacted with XML based responses but I
think the root tag is essentially ignored and you specify the level
past that.

- Todd

--- In flexcoders@yahoogroups.com, "Clinton D. Judy" <[EMAIL PROTECTED]> wrote:
>
> Sorry about not being descriptive enough. What I meant was, my browser
> would crash, and Flex Builder would bring up the httpservice source code
> where the error happened. That's not happening anymore, but it's still
> not populating my datagrid.
> 
>  
> 
> This is my current source code:
> 
>  
> 
> <?xml version="1.0" encoding="utf-8"?>
> 
> <mx:Application
> 
>       xmlns:mx="http://www.adobe.com/2006/mxml";
> 
>       layout="vertical" horizontalAlign="center" verticalAlign="top"
> 
>       width="100%" height="100%" creationComplete="checkJobs.send()">
> 
>       <mx:Script>
> 
>             <![CDATA[
> 
>                   import mx.controls.Alert;
> 
>                   import mx.rpc.events.ResultEvent;
> 
>                   
> 
>                   private function
> getResultOk(r:Number,event:Event):void{
> 
>                         if(!r){
> 
>                               Alert.show('Error sending data!!');
> 
>                               return;
> 
>                         }
> 
>  
> datagrid.dataProvider=checkJobs.lastResult.jobs.job;
> 
>                         Alert.show( String(this.checkJobs.lastResult) );
> 
>                   }
> 
>             ]]>
> 
>       </mx:Script>
> 
>       <mx:HTTPService   id="checkJobs"
> url="http://localhost:3001/jobs.xml";
> 
>             contentType="application/x-www-form-urlencoded"
> 
>             method="POST" resultFormat="e4x" useProxy="false"
> 
>             result="getResultOk(1,event)"
> 
>             fault="getResultOk(0,event)" />
> 
>       <mx:DataGrid id="datagrid" width="100%" height="60%">
> 
>             <mx:columns>
> 
>                   <mx:DataGridColumn headerText="Name" dataField="name"
> />
> 
>                   <mx:DataGridColumn headerText="ECMS" dataField="ecms"
> />
> 
>             </mx:columns>
> 
>       </mx:DataGrid>
> 
>       <mx:Button label="check jobs"
> click="blah.text='';checkJobs.send()" />
> 
>       <mx:TextArea id="blah" text="{checkJobs.lastResult}" />
> 
> </mx:Application>
> 
>  
> 
> The XML is still the same from earlier. I tried both jobs and jobs.job
> to no avail. Any thoughts?
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Beau Scott
> Sent: Monday, May 19, 2008 6:08 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Grr, HTTPService doesn't work when it should
> 
>  
> 
> A little more information on the fault than "shuts down hard"  would be
> helpful.
> 
> In any case, some webservers won't let you POST to an XML document, try
> changing the HTTPService method to "GET".
> 
>  
> 
> Beau
> 
>  
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Clinton D. Judy
> Sent: Monday, May 19, 2008 2:23 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Grr, HTTPService doesn't work when it should
> 
>  
> 
> I tried Charles, and discovered I was sending this to Rails:
> 
>  
> 
> <> 
> 
>  
> 
> This doesn't seem right, and sure enough, Rails is throwing errors when
> it receives that. So it's gotta be my HTTPService, but I don't know
> where to begin fixing it.
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Clinton D. Judy
> Sent: Monday, May 19, 2008 4:13 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Grr, HTTPService doesn't work when it should
> 
>  
> 
> I tried this, it didn't work. I thought you still referred to the first
> element in an array in Flex, not its parent class. Are you sure my
> HTTPService is fine?
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Jeff Vroom
> Sent: Monday, May 19, 2008 3:59 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Grr, HTTPService doesn't work when it should
> 
>  
> 
> I think at least you need to change:
> 
>  
> 
> checkJobs.lastResult.jobs.job
> 
>  
> 
> to:
> 
>  
> 
> checkJobs.lastResult.jobs
> 
>  
> 
> the DataGrid is expecting a list of jobs, not just a single job.  
> 
>  
> 
> Jeff
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Clinton D. Judy
> Sent: Monday, May 19, 2008 12:52 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Grr, HTTPService doesn't work when it should
> 
>  
> 
> This may be a simple problem, but Flex shuts down hard when I try this
> code:
> 
>  
> 
>  
> 
> <?xml version="1.0" encoding="utf-8"?>
> 
> <mx:Application
> 
>       xmlns:mx="http://www.adobe.com/2006/mxml";
> 
>       layout="vertical" horizontalAlign="center" verticalAlign="top"
> 
>       width="100%" height="100%" creationComplete="checkJobs.send()">
> 
>       <mx:Script>
> 
>             <![CDATA[
> 
>                   import mx.controls.Alert;
> 
>                   import mx.rpc.events.ResultEvent;
> 
>             ]]>
> 
>       </mx:Script>
> 
>       <mx:HTTPService id="checkJobs"
> url="http://127.0.0.1:3001/jobs.xml"; useProxy="false"
> contentType="application/xml" method="POST" />
> 
>       <mx:DataGrid id="jobs" width="100%" height="60%"
> dataProvider="{checkJobs.lastResult.jobs.job}">
> 
>             <mx:columns>
> 
>                   <mx:DataGridColumn headerText="Name" dataField="name"
> />
> 
>                   <mx:DataGridColumn headerText="ECMS" dataField="ecms"
> />
> 
>             </mx:columns>
> 
>       </mx:DataGrid>
> 
>       <mx:Button label="check jobs" click="checkJobs.send()" />
> 
> </mx:Application>
> 
>  
> 
>  
> 
> And the accompanying XML file:
> 
>  
> 
>  
> 
> <jobs type="array">
> 
>   <job>
> 
>     <created-at type="datetime">2008-05-19T10:35:48-04:00</created-at>
> 
>     <display-order type="integer" nil="true"/>
> 
>     <ecms>1923</ecms>
> 
>     <id type="integer">1</id>
> 
>     <job-id nil="true"/>
> 
>     <name>199238GAME</name>
> 
>     <updated-at type="datetime">2008-05-19T10:35:48-04:00</updated-at>
> 
>   </job>
> 
>   <job>
> 
>     <created-at type="datetime">2008-05-19T14:20:52-04:00</created-at>
> 
>     <display-order type="integer" nil="true"/>
> 
>     <ecms>1553</ecms>
> 
>     <id type="integer">2</id>
> 
>     <job-id nil="true"/>
> 
>     <name>asdgggd</name>
> 
>     <updated-at type="datetime">2008-05-19T14:20:52-04:00</updated-at>
> 
>   </job>
> 
> </jobs>
> 
>  
> 
>  
> 
> Why isn't the datagrid being populated?
> 
>  
> 
> Clinton Judy
> 
> Web Developer
> 
> Glenn O. Hawbaker, Inc.
> 
>  
> 
>  
> 
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.23.21/1454 - Release Date:
> 5/19/2008 7:44 AM
> 
>  
> 
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.23.21/1454 - Release Date:
> 5/19/2008 7:44 AM
>


Reply via email to