6 Replies Latest reply on Jun 19, 2007 5:53 PM by ntsiii

    Tab initialisation

    ldevaraj
      Hi,

      I am a newbie to flex.
      I have a tabNavigator (two tabs/two canvas) in my mxml file.
      I need to populate some fields in both the tabs with some defaults.
      I am able to set values to fields in the first tab but when i do the same for the 2nd tab
      flex throws an error saying cannot access property of null object reference.

      Seems like i need to initialize something but no clue.

      Can some one help me.
      Below is my code.


      private function populateCreateData():void {
      cparkConstruct = new CallParkingBean();
      timeout.text=cparkConstruct.timeOut; // --> (works fine in 1st tab)
      advRepeat.text=cparkConstruct.limit; // -->(error for setting field in 2nd tab.)
      advTimeout.text=cparkConstruct.timeOut; // -->(error for setting field in 2nd tab.)
      }
      <mx:TabNavigator x="49" y="78" id="cparktab" width="524" height="374">
      <mx:Canvas label="Basic" width="484" id="basicCanvas" height="312">
      <mx:TextInput x="180" y="135" width="89" id="timeout"/>
      </mx:Canvas>

      <mx:Canvas label="Advanced" width="520" id="advancedCanvas" height="340">
      <mx:TextInput x="248.25" y="77" width="50" id="advTimeout" editable="true"/>
      <mx:TextInput x="248.25" y="107" width="50" id="advRepeat" editable="true"/>
      </mx:Canvas>
      </mx:TabNavigator>



      Thanks in advance.
      Lakshmi