1 Reply Latest reply on Feb 22, 2009 10:45 PM by Madhav Subedi

    Rookie issue

    ignaciosz
      Hi, i just new using flex and i have my first issue trying to create an script:

      Why cannot display my values?

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

      <!-- Valores de retorno -->
      <mx:Script>
      <![CDATA[
      import mx.rpc.events.ResultEvent;

      [Bindable]
      private var r:XML;

      public function fill():void {
      verhoteles.selectedIndex=1;
      h_cuernavaca.send();
      }

      public function resultHandler(event:ResultEvent):void {
      r = XML(event.result);
      }
      ]]>
      </mx:Script>

      <!-- Define el servicio HTTP -->
      <mx:HTTPService
      id="h_cuernavaca"
      contentType="application/xml"
      url=" http://www.e-travelsolution.com.mx/xml/xmlservice.asmx/getHotels?asoc=prueba&lt;lang=&lt;t ext=1&lt;order=2&lt;curr=US&lt;arrive=&lt;depart=&lt;hotel=&lt;destid=57&lt;max=&lt;new=&l t;cityiD=&lt;catid="
      useProxy="false"
      method="POST"
      resultFormat="e4x"
      result="resultHandler(event)"
      >
      </mx:HTTPService>

      <!-- Crea la vista de datos -->
      <mx:ViewStack id="verhoteles" >
      <mx:Panel label="Ver Hoteles Cuernavaca" >
      <mx:DataGrid>
      <mx:columns>
      <mx:DataGridColumn headerText="Hotel" dataField="NH"/>
      <mx:DataGridColumn headerText="Categoria" dataField="KS"/>
      <mx:DataGridColumn headerText="Estatus" dataField="SH"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Panel>
      </mx:ViewStack>

      </mx:Application>

      Text Why cannot display my values?
        • 1. Re: Rookie issue
          Madhav Subedi Level 4
          follow some steps:
          1. set the dataprovider of your datagrid
          2. make sure that your URL returns a valid xml, as i can see, the link doesnot give any feeds.
          - you can alert the value of returned result in your resultHandler.