0 Replies Latest reply on Apr 6, 2010 11:48 PM by hiwa118

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    hiwa118

      hi every body

      i am new in flex and action script.

      i have  one form that i add it formItems and it was worked very well after added  textInput and when i want to access to textInput text it gives me thid  error.

      i am just freaking out , i don't know couse of this error  ,i have another formItem with comboBox element and i can access to value  of selectedItem in that very easily.please if you have any ideas about  this error please help me

      thanks.

       

      my code

       

      in  this state i am adding one comboBox and two textInput to the form

       

      <mx:State  name="base">
                   <mx:AddChild relativeTo="{selectForm}"  position="lastChild"
                       creationPolicy="all">
                       <mx:FormItem id="os1" label="state">
                           <mx:ComboBox id="state"  dataProvider="{stateArray}" close="ostan_closeHandler(event)" />
                       </mx:FormItem>
                   </mx:AddChild>
                   <mx:AddChild relativeTo="{selectForm}"  position="lastChild"
                       creationPolicy="all">
                       <mx:FormItem  label="{lab16}">
                           <mx:TextInput id="dateInput" editable="true"/>
                       </mx:FormItem>
                   </mx:AddChild>
                   <mx:AddChild relativeTo="{selectForm}"  position="lastChild"
                       creationPolicy="all">
                       <mx:FormItem  label="{lab17}">
                           <mx:TextInput  id="dateInput1"  editable="true"/>
                       </mx:FormItem>
                   </mx:AddChild>

      </mx:State>

       

      and  in this part of cod i handle event of button click where error occur

       

      case  "rep_shek_tedad":
                           if(state.selectedItem != null){
                               stateSelectedItem = state.selectedItem;
                                srv.getShekayatCount(stateSelectedItem.data,dateInput.text,dateInput1.text);
                           }else {
                                srv.getShekayatCount(null,this.dateInput.text,this.dateInput1.text);
                           }
                           currentState = 'enterCharts';