2 Replies Latest reply on Apr 6, 2007 1:22 PM by Gil1

    TabNavigator: creating the tabs from an XML file

    Gil1 Level 1
      I would like to create the tabs for a TabNavigator dynamically and not hard coded as I have them currently (since the info to generate them comes already from an xml file). is a repeater a solution for this? or what other approaches can I take?

      The current code looks like:

      mx:TabNavigator width="396" height="567" y="10" cornerRadius="0"
      id="tn1" change="onTabChange(event)" creationPolicy="all">

      <mx:Panel title="Modules" label="Modules" width="100%" height="100%" layout="absolute"
      fontSize="14" click="currentState=''" >

      <mx:List id="cList1" dataProvider="{contentList..module}" labelField="name" x="0" y="0"
      width="100%" height="100%" change="changeHandler(event)" fontSize="12"></mx:List>
      </mx:Panel>
      <mx:Panel title="Images" label="Images" width="100%" height="100%" layout="absolute"
      fontSize="14" click="currentState=''">
      <mx:List id="cList2" dataProvider="{contentList..image}" labelField="name" x="0" y="0"
      width="100%" height="100%" change="changeHandler(event)" fontSize="12"></mx:List>
      </mx:Panel>
      <mx:Panel title="Movies" label="Movies" width="80%" height="100%" layout="absolute"
      fontSize="14" click="currentState='video'" dataChange="changeHandler1(event)">
      <mx:List id="cList3" dataProvider="{contentList..movie}" labelField="name" x="0" y="0"
      width="100%" height="100%" fontSize="12"></mx:List>
      </mx:Panel>
      <mx:Panel title="Feedback" label="Feedback" width="100%" height="100%" layout="absolute"
      fontSize="14" click="currentState=''">
      <mx:List id="cList4" dataProvider="{contentList..image}" labelField="name" x="0" y="0"
      width="100%" height="100%" change="changeHandler(event)" fontSize="12"></mx:List>
      </mx:Panel>
      <mx:Panel title="References" label="References" width="100%" height="100%" layout="absolute"
      fontSize="14" click="currentState=''">
      <mx:List id="cList5" dataProvider="{contentList..image}" labelField="name" x="0" y="0" width="100%" height="100%"></mx:List>
      </mx:Panel>
      <mx:Panel title="Search" label="Search" width="80%" height="100%" layout="absolute"
      fontSize="14" click="currentState=''">
      <mx:List id="cList6" labelField="title" x="0" y="0" width="100%" height="100%"
      change="changeHandler(event)" fontSize="12"></mx:List>
      </mx:Panel>
      </mx:TabNavigator>

      Gilbert