1 Reply Latest reply on Aug 31, 2010 12:39 PM by UbuntuPenguin

    TabBar's ViewStack set from outside

    Antoine Alberti



      I have a component that contains a spark TabBar (sdk 4.1). Because it's a SkinPart, the component is written in actionScript. And because we find the code that composes applications more readable in mxml, we'd prefer defining the viewstack in another mxml file.


      But... I didn't find how to make this work. Or there is a bug in spark TabBar or mx ViewStack. Actually the view stack is displayed, but not the tab bar.


      Here's the tiniest code I could to demonstrate the issue.



          import spark.components.Group;
          import spark.components.TabBar;

          public class TabsWithContent extends Group
              public var tabs:TabBar;
              public function TabsWithContent()



      <?xml version="1.0" encoding="utf-8"?>


      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"




                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">




              <!-- Place non-visual elements (e.g., services, value objects) here -->














                  <s:TabBar dataProvider="{vs}"/>




              <mx:ViewStack id="vs">


                  <s:NavigatorContent label="1">


                      <s:Label text="11"/>




                  <s:NavigatorContent label="2">


                      <s:Label text="22"/>










      What did I not understand? What should I do to correct or workaround this?