0 Replies Latest reply on Jun 10, 2009 9:59 PM by Rajesh Subbiah

    Unable to fix

    Rajesh Subbiah

      Hi

      Anyone can fix the problem in this code .

      I am not getting anything the datagrid.

       

       

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Script>
         <![CDATA[
          import mx.rpc.events.ResultEvent;
          import mx.rpc.events.FaultEvent;
          import mx.controls.Alert;

       

          [Bindable]
          private var xmldata:XML;

       

         private function send_data():void {
               httpXmlDataService.send();
          }

       

         private function faultHandler(event:FaultEvent):void{
               mx.controls.Alert.show(event.fault.message,"Error in getting result");
          }
         private function resultHandler(event:ResultEvent):void{
              xmldata=event.result as XML;
         }
       
        
         ]]>
      </mx:Script>

       

      <mx:HTTPService  id="httpXmlDataService"
              url="http://localhost:8080/InfraLabWebApp/properties.xml"
              resultFormat="e4x"
              result="resultHandler(event)"
              fault="faultHandler(event)"
             />
      <mx:Panel x="43" y="10" width="588" height="369" layout="absolute">
      <mx:DataGrid x="50" y="23" width="469" height="265" dataProvider="{xmldata.root.sample}">
       
      </mx:DataGrid>
      <mx:Button x="66" y="296" label="Get Data" click="send_data()" />
      </mx:Panel>

       

                    
      </mx:Application>

       

       

       

      but if i use the dataprovider as httpXmlDataService.lastResult.root.sample

      i am able to get the values in datagrid