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

    Float Data Type Does Not Get POSTED to HTTPSerivce


      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.


      Attach code:

      <mx:HTTPService id="update_records" url="http:/localhost/update_record.php" useProxy="false" method="POST">
      <mx:request xmlns="">
      <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"
      <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:Form width="100%" height="50%" y="225">
      <mx:FormItem label="Scenario ID">
      <mx:Label text="{dg.selectedItem.scenario_id}"/>
      <mx:FormItem label="Scenario Name">
      <mx:Label text="{dg.selectedItem.scenario_name}"/>
      <mx:FormItem> <mx:Label text="{dg.selectedItem.market}" color="#990000"/>
      <mx:FormItem> <mx:Label text="{dg.selectedItem.IM_accept}" color="#990000"/>
      <mx:FormItem> <mx:Label text="{dg.selectedItem.IM_defer}" color="#990000"/>
      <mx:Button label="Update Record" id="mySubmitButton2" click="update_records.send()" x="350"/>
        • 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.

          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)

          • 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.