0 Replies Latest reply on Oct 9, 2009 12:34 PM by Dharmesh Chheda

    Style not applied to tab in TabNavigator?

    Dharmesh Chheda

      Hi

       

          Here is the sample app

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
          layout="absolute" width="100%">
         
          <mx:Script>
              <![CDATA[
                  import mx.containers.Panel;
                  public var count:Number =0;
                  public function addTab():void{
                      var pan:Panel = new Panel();
                      pan.name="Tab " + count;
                      theNav.addChild(pan);
                      count++;
                  }
                 
                  public function removeTab():void{
                      var childNum:Number = theNav.getChildren().length;
                      if(childNum>0){
                          theNav.removeChildAt(childNum-1);
                      }
                  }
              ]]>
          </mx:Script>

       


          <mx:Button label="Add Tab" click="addTab()" x="24" y="26"/> <mx:Button label="Remove Tabs" click="removeTab()" x="104" y="26"/>

       

          <mx:TabNavigator id="theNav" x="36" y="76" width="100%">
         
          </mx:TabNavigator>

       

      </mx:Application>   

       

      Try adding a tab and then removing it using the buttons provided. Then again add a tab by clicking the button. Notice that the tab bar does not show the style of the one and only tab as selected. Is this a known issue?..

       

      Thanks

      Dharmesh