0 Replies Latest reply on Dec 18, 2006 4:26 AM by kpraja

    Edit Operation

    kpraja
      Hi All,

      I am new to flex. i need to perform Edit operation.
      After completing the add operation means storing values in to database and populating values in datagrid also.After that if i am selecting one record in the datagrid and clicking on Edit the selected record state and country values are not populating in to their comboboxes, it s displaying default values.
      My requirement is to populate the values(selected record values ) in the comboboxes like country,state etc.
      For that i wrote below code , but i am getting scripting error(code for state )

      private function showStateCombo():void{
      if(dataGridDep.selectedIndex >= 0){
      if(model.globalvalues.statesArrayCB != null){
      for(var i:int=0; i<model.globalvalues.statesArrayCB.length;i++)
      {
      if(dataGridDep.selectedItem.STATE== model.globalvalues.statesArrayCB.getItemAt(i).STATE)
      {
      mx.controls.Alert.show("if statement executed!!");
      s=i;
      break;
      }
      }
      }
      }


      dataGridDep-->id of datagrid
      model.globalvalues.statesArrayCB --> collection of all states
      STATE--> element in the xml structure

      xml structure
      -------------------

      <STATES>
      <STATE>Tamil</STATE>
      .
      .
      .
      .
      .</STATES>


      can any one help for resolving this issue.