2 Replies Latest reply on May 29, 2007 10:54 PM by ethernutZA

    Tab Navigator 1009 Null Object Reference

      Hello Fellow Flex'ers

      I have this extremely frustrating problem. In short, I have tables with up to 15 fields. This is too much to fit onto 1 screen neatly, so I break them up into sections over 3 to 4 tabs on a tab navigator (or accordian). The problem is that neither the dataProvider nor any function can reference any of the UI components on the other tabs until I have physically clicked each tab to 'load the UI components into screen cache'. Once I have done that then the app functions great.

      Example :

      Copy this code and compile it. On tab 2 is an input box. Tab 1 must be able to read the data in Tab 2 and alert you as to what it is. If you compile and click the tab 1 button it throws the error . If you compile and click tab 2, then tab 1 then the button, it works.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      import mx.controls.Alert;

      <mx:TabNavigator x="71" y="66" width="242" height="240">
      <mx:Canvas label="Tab 1" width="100%" height="100%">
      <mx:Button x="55.5" y="72" label="Get Tab 2 Input" width="129" id="btnGetInput" click="Alert.show(txtInput.text);"/>
      <mx:Canvas label="Tab 2" width="230" height="221">
      <mx:TextInput x="35" y="72" id="txtInput" text="You can see me!!"/>

      Help pleeeeease?