3 Replies Latest reply on Jul 11, 2006 1:08 PM by Flex harUI

    Strange behavior with a datagrid

    ekokurtz
      I have a datagrid (populated by an array) that contains some census information (birthdate, salary, etc). When this data gets sent off to a cfc for processing, the grid gets cleared out and the value of the variable in the cfreturn tag gets entered in the first row of each column. I am not referencing the array other than sending to the cfc through a remote object call, so I am not sure why this is happening.

      here is the setup for the cfc call, and the call itself:

      <mx:RemoteObject id="calcPremium" destination="ColdFusion" source="components.opus" result="showPrem_calc(event); "/>

      //validate fields and send info to cfc for calculation
      public function calcPrem() {
      var pattern:RegExp = /\D/g; // get rid of all but digits
      var msg = '';


      //check SIC code
      var sicValue = sicCode.text.replace(pattern,""); //scrub values for sic Code
      if (sicValue.length == 0 || (isNaN(sicValue) == true)) {
      msg = msg + ' - SIC Code\n';
      }


      //show alert, if necessary
      if (msg != '') {
      Alert.show('Please correct the following:\n'+msg);
      }
      else if (msg == '') {
      Alert.show(censusArray.length.toString());
      censusData.calcPremium(censusArray,classValues,sicCode.text,rateType.selectedValue);
      }
      }

      /////////////////////////////////////////

      public function showPrem_calc (event:ResultEvent) {
      //display results from cfc calculating premium
      Alert.show(censusArray.length.toString());

      }

      <mx:Button click="calcPrem();" label="Calculate Premium" height="25" "/>

      Anything jumping out that I am missing??