2 Replies Latest reply on Nov 14, 2008 7:36 AM by alice_data

    Float Data Type Does Not Get POSTED to HTTPSerivce

    alice_data Level 1
      Hi,

      I am creating a small application to allow users update records, but currently it appears that only those with String data types get sent through and get updated, while the others like integers or float data types do not.

      Is there any specific explanation for this? I am sure that I have missed something here.
      Anything is appreciated.

      Alice


      Attach code:

      <mx:HTTPService id="update_records" url="http:/localhost/update_record.php" useProxy="false" method="POST">
      <mx:request xmlns="">
      <scenario_id>{dg.selectedItem.scenario_id}</scenario_id>
      <scenario_name>{dg.selectedItem.scenario_name}</scenario_name>
      <market>{dg.selectedItem.market}</market>
      <IM_accept>{dg.selectedItem.IM_accept}</IM_accept>
      <IM_defer>{dg.selectedItem.IM_defer}</IM_defer>
      </mx:request>
      </mx:HTTPService>
      <mx:Canvas id="scenario_build" label="Scenario Design" height="100%" width="100%" backgroundColor="#F0FFFF" x="0" y="0" creationComplete="update_records.send()">

      <mx:DataGrid id="dg" x="25" y="45" width="90%" height="20%" editable="true"
      dataProvider="{scenario_elements_create.lastResult.scenarios.scenario}">
      <mx:columns>
      <mx:DataGridColumn dataField="scenario_id" width="32" headerText="ID" editable="false" visible="true"/>
      <mx:DataGridColumn dataField="scenario_name" headerText="Name" editable="true" visible="true"/>
      <mx:DataGridColumn dataField="market" headerText="Market" editable="true" width="88"/>
      <mx:DataGridColumn dataField="IM_accept" headerText="IM Accepted" editable="true"/>
      <mx:DataGridColumn dataField="IM_defer" headerText="IM Deferred" editable="true"/>
      </mx:columns>
      </mx:DataGrid>
      <mx:Form width="100%" height="50%" y="225">
      <mx:FormItem label="Scenario ID">
      <mx:Label text="{dg.selectedItem.scenario_id}"/>
      </mx:FormItem>
      <mx:FormItem label="Scenario Name">
      <mx:Label text="{dg.selectedItem.scenario_name}"/>
      </mx:FormItem>
      <mx:FormItem> <mx:Label text="{dg.selectedItem.market}" color="#990000"/>
      </mx:FormItem>
      <mx:FormItem> <mx:Label text="{dg.selectedItem.IM_accept}" color="#990000"/>
      </mx:FormItem>
      <mx:FormItem> <mx:Label text="{dg.selectedItem.IM_defer}" color="#990000"/>
      </mx:FormItem>
      <mx:Button label="Update Record" id="mySubmitButton2" click="update_records.send()" x="350"/>
      </mx:Form>
      </mx:Canvas>
        • 1. Re: Float Data Type Does Not Get POSTED to HTTPSerivce
          ntsiii Level 3
          First, I advise againse declaritive creation of the request object. It is just too hard to debug. How do you know that all of the request parameters have the correct values when you send()?

          You don't. I would eliminate that first before theorizing on data type issues.

          Build the request object in AS and invoke send there, so you can inspect the values.

          Untested:
          private function doUpdate():void {
          var oRequest:Object = new Object();
          oRequest.scenario_id = dg.selectedItem.scenario_id;
          oRequest.scenario_name = dg.selectedItem.scenario_name;
          oRequest.market = dg.selectedItem.market;
          oRequest.IM_accept = dg.selectedItem.IM_accept;
          oRequest.IM_defer = dg.selectedItem.IM_defer;
          trace("market:" + oRequest.market)
          update_records.send(oRequest)
          }

          Tracy
          • 2. Re: Float Data Type Does Not Get POSTED to HTTPSerivce
            alice_data Level 1
            Thanks, I eventually changed my structure a little, and I don't seem to having a problem anymore.