Tab Navigator Question

I have created a <mx:TabNavigator> with a few <s:NavigaortContent> children.  On creationComplete of the applicaiton, I set the selectedIndex of the navigator, depending on the currentState.
When I run the applicaiton, I see the correct content for the set selectedIndex, but the tabs at the top show that tab 0 is selected (so the visually selected tab does not match the content of the selectedIndex).
Am I missing something?  I don't recall this being all that difficult of a thing to do.
Thanks!
Jenn

OK - I have each navigator content labelled... Here is the code I'm using if that helps out...
<mx:TabNavigator width="90%" height="90%" horizontalCenter="0" verticalCenter="0" id="navTabs" fontFamily="Arial" fontSize="12" change="tabChanged()">
        <s:NavigatorContent id="tnHome" label="Home" width="100%" height="100%" includeIn="administrator,default,student" >
               <!-- my content is here -->
        </s:NavigatorContent>
        <s:NavigatorContent includeIn="default, student,administrator" label="About" width="100%" height="100%" id="tnAbout">
                <!-- my content is here -->
        </s:NavigatorContent>
</mx:TabNavigator>
private function initApp():void
     if ( user.role == "student" ) {
          currentState = "student";
          navTabs.selectedIndex = 0;
          Alert.show("you are a student");
   else if ( user.role == "admin" ) {
         currentState = "administrator";
         navTabs.selectedIndex = 1;
protected function tabChanged():void
                switch(navTabs.selectedIndex) {
                    case 0 : //home
                        break;
                    case 1:
                        break;
                    case 2: //Courses
                        courses.getAllList();
                        break;
                    case 3: //My Training
                        //from here, we want to get get any/all registrations and history
                        break;
                    case 4: //Resource
                        courses.getAllResources();
                        break;
                    case 5: // Administration
                        break;
So, when I enter in with the role of admin, I see the content of the About tab, but the 'selected tab' at the top is still the Home tab.   Hope that clears up my problem.
Thanks!

Similar Messages

  • How to open the popup with in Tab navigator  working area.

    Hi,
              I using the customized  panel to open it as popup by using  popup manager in the Tab navigator . The popup should be able to  move with in the tab navigator's  content area. Not outside of the tab navigator's  content area. How to do this? .What is the difference between opening the popup by using popup  manager and add children(); which one is best?
    Regards,
    Thiru

    It depends on your purpose. A popup displays information to the user, and it might be modal if the user should repsond to the popup before continuing, but why constrain it's movement to the space occupied by the TabNavigator.
    You could, in theory, check the x and y properties of the popup position, and then compare those with the x and y of the TabNavigator view area, though you might have to do some conversion between global and local coordinates.
    You might want to consider your design. Is a popup necessary? Perhaps not. If so, maybe do not consider constraining its movement as you have indicated.
    If this post answers your question or helps, please mark it as such.

  • Why data are not getting poulated in dynamically added tab in a tab navigator???

    Hi All,
    I am facing a very strange problem and need you expert opinion on this. Ok so the problem goes like this:
    In my application i have a tab navigator where i have 2 fixed tabs say tab A and tab B. In tab B I have a data grid where All the user name are getting populated. Once the user clicks on any datagrid row i am dynamically adding a new tab based on username , so if in my datagrid u1,u2 and u3 are getting displayed then once you clik on u1 a new tab called u1 is getting displayed. Code for this goes like this:
    var vbox1: VBox= new VBox();
    box1.label=mydatagrid.selectedItem.uName;
    var sde:* = new searchDetails();
    vbox1.addChild(sde);
    myTabnavigator.addChild(vBox1);
    Application.application.searchdetails.displayall();
    I have created a component called searchDetails where i have designed the page wit various fields for this tab.This also has a method called displayall() which is populating the data in all fields using php an my sql where i have designed the page wit various fields for this tab.
    New tab is getting displayed perfectly. My problem is once the tab is getting displayed fields are not getting populated with data.
    Please let me know what wrong i am doing. I am really struggling

    Hmm.. you have to assign text to the labelfields on creation complete not before that, the fllow will be like this
    var vbox1: VBox= new VBox();
    var sde:* = new searchDetails();
    vbox1.addEventListener(creationcompleteevent,function);
    vbox1.addChild(sde);
    myTabnavigator.addChild(vBox1);
    function(e:event):void{
    box1.label = "text";

  • Tab navigation does not show at all in FP 10 it shows in FP9

    Hi,
    I have module that is loaded at runtime,
    it has simple tab navigation with 3 children,
    in FlashPlaer 9 Debug, tab navigation shows fine, even
    thought for some reason it looks like linkbar :)
    also numericStepper looks like inputBox and ComboBox has no
    arrow, (they all look fine in FB 3.2)
    in Flash player 10 tab navigation does not show at all, is
    there any obvious thing that I am missing ?
    I am guessing something terribly wrong with flex styles, but
    I am not overriding any styles,
    my environment :
    vindows Vista 64 bit (although I use jvm 32)
    project is build with latest flex sdk :flex_sdk_3.3.0.4589
    P.S: I cant attach image here, so I will record video
    tomorrow, if that will help.
    thanks in advance
    Levan

    bump :)
    anybody , please please :)

  • Inserting tabbed navigation code makes my web page not display in design view..

    Hi everyone..
    I am on Dreamweaver 8 for MAC, and was working on a couple of web pages..these pages included divs and tables. But when I tried inserting a tabbed navigation I found at:
    http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
    In a nutshell, it asked me for step 1 to:
    Step 1: Insert the        below CSS and script into the HEAD section of your page:
    <link rel="stylesheet" type="text/css" href="tabcontent.css" />
    <script type="text/javascript" src="tabcontent.js">
    * Tab Content script v2.2- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    </script>
    The next step was this:
    Step 2: Finally, simply add the below      HTML to where you wish the Tab Content to appear on the page:
    <h3>Demo #1- Basic implementation</h3>
    <ul id="countrytabs" class="shadetabs">
    <li><a href="#" rel="country1" class="selected">Tab 1</a></li>
    <li><a href="#" rel="country2">Tab 2</a></li>
    <li><a href="#" rel="country3">Tab 3</a></li>
    <li><a href="#" rel="country4">Tab 4</a></li>
    <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
    </ul>
    <div style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">
    <div id="country1" class="tabcontent">
    Tab content 1 here<br />Tab content 1 here<br />
    </div>
    <div id="country2" class="tabcontent">
    Tab content 2 here<br />Tab content 2 here<br />
    </div>
    <div id="country3" class="tabcontent">
    Tab content 3 here<br />Tab content 3 here<br />
    </div>
    <div id="country4" class="tabcontent">
    Tab content 4 here<br />Tab content 4 here<br />
    </div>
    </div>
    <script type="text/javascript">
    var countries=new ddtabcontent("countrytabs")
    countries.setpersist(true)
    countries.setselectedClassTarget("link") //"link" or "linkparent"
    countries.init()
    </script>
    <p><a href="javascript:countries.cycleit('prev')" style="margin-right: 25px; text-decoration:none">Back</a> <a href="javascript: countries.expandit(3)">Click here to select last tab</a> <a href="javascript:countries.cycleit('next')" style="margin-left: 25px; text-decoration:none">Forward</a></p>
    <hr />
    Well, I did all the steps required, but when I put this inside a div I had inside a table, all of a sudden I couldnt see anything in my design view, only two tables that arent even the same size..When I take out all this code, I get back my regular page..Can I see this tabbed navigation in my design view? Unfortunately, I dont have the spry widgets since I am on Dreamweaver 8..If I preview it in both Safari and Firefox (on Mac Firefox/3.0.8) (Safari 3.2.1) I can see everything fine, including the tabbed navigation..But designing in code isnt really helpful because I want to see what it looks like in design view, in case we change things-its just easier for me to work on..So I assume there is something in this code that is making my design view show nothing..
    Update:I tried taking out the code again, but this time, I couldnt see anything again, even without this code..
    I know that I can go to validation website, and I got a lot of errors-but all the pages I have that are in the same style have those same errors too—and they display fine..its only when I insert this specific piece of code that everything goes haywire..Is it even possible to view tabbed navigations (like the one in the above link) inside of Dreamweaver Design View?
    Any help would be appreciated..

    DW8 doesn't render any dynamic content, so I'd say it's a no go. You'll just have to live with that limitation or upgrade to CS4...
    Mylenium

  • Applet TAB navigation not working with 1.4.1_01

    I recently upgraded to Java version 1.4.1_01. Now, when I load my applets, the TAB key cannot be used for navigation until I open the Java console and then close it again. To ensure that my the threads in my specific Applet are not the problem, I came up with the following test applet:
    import java.awt.BorderLayout;
    import javax.swing.BoxLayout;
    import javax.swing.JApplet;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class TestApplet extends JApplet {
        public void init() {
            super.init();
        public void start() {
            JPanel myPanel = new JPanel();
            myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.Y_AXIS));
            JTextField textField1 = new JTextField("Text Field 1");
            myPanel.add(textField1);
            JTextField textField2 = new JTextField("Text Field 2");
            myPanel.add(textField2);
            JTextField textField3 = new JTextField("Text Field 3");
            myPanel.add(textField3);
            getContentPane().add(BorderLayout.CENTER, myPanel);
        public void stop() {
            super.stop();
    }To ensure that my build environment/options are not the problem, I compiled this applet as follows:
    javac TestApplet.java
    I then came up with the following HTML file for the applet:
    <HTML>
    <HEAD>
    <TITLE>Test Applet</TITLE>
    </HEAD>
    <BODY MARGINWIDTH="0" MARGINHEIGHT="0" BGCOLOR="white">
    <APPLET
    CODE=TestApplet.class
    WIDTH=635
    HEIGHT=500
    ALIGN=left
    VSPACE=10
    HSPACE=10
    >
    </APPLET>
    </BODY>
    </HTML>When I access this test applet, again I am not able to navigate among the text fields with the TAB key. However, if I open the Java console, close it right back up, and refresh my applet, the TAB navigation works. I've tried simply refreshing my applet (as well as a hundred other things) and have had no success.
    Any help would be GREATLY appreciated.
    Thanks in advance

    Looks like this is related to Bug #4707289. To fix this,
    I added the following lines to the above applet:
    textField1.setFocusable(true);
    textField2.setFocusable(true);
    textField3.setFocusable(true);

  • Substitution syntax in tabbed navigation list. Smart or Lucky?

    I've got a tabbed navigation list that I use on two separate pages.
    The list entry points back to the current page but sets a page item value based on the list item value.
    So this tabbed list might have items labeled E-mail, Phone, Address. When you click one of the list tab items it submits to the current page, sets a hidden field to EMAIL,PHONE, or ADDRESS. That hidden field controls which email,phone, or address region is displayed.
    OK easy enough. Except that I use the same list on multiple pages. Rather than create a list for each page, I made it more generic...
    So I set the item target as follows:
    Target type: Page in this application
    Page: &APP_PAGE_ID.
    Set these items: P&APP_PAGE_ID._ALIAS_REGION
    With these values: ADDRESS
    Notice that I've got substitution type syntax for the target page and the NAME of the item whose value I want to set. For example if the list is rendered on page 2 the target page becomes 2 and the item name becomes P2_ALIAS_REGION. On page 7, they are 7 and P7_ALIAS_REGION respectively.
    I also use this same syntax in the "Current List Entry" with a query like:
    select 1 from dual where :P&APP_PAGE_ID._ALIAS_REGION = 'ACTIVE'
    Now, I thought I was being clever in doing this, since it lets me use the same list on several similar pages. However the Apex Essentials Advisor is complaining about my syntax, and as awesome as that tool is, it got me thinking that I might be too clever for my own good.
    Is it valid to use this substitution syntax in this context? I mean it works, but is it supposed to work this way? If this is by happy coincidence then Apex developers please don't change how this works. If this is by design, then you guys/girls are awesome!

    Is it valid to use this substitution syntax in this context?Yes.
    I mean it works, but is it supposed to work this way?Yes.
    If this is by happy coincidence then Apex developers please don't change how this works.It is very unlikely that we would change any of the core substitution logic in ways that adversely affect behavior like this.
    If this is by design, then you guys/girls are awesome!Aw, shucks.
    Scott

  • Tab Navigation in ABAP screens

    Hi All,
    Is the navigation sequence of the screen elements in a dynpro screen on "tab" event is from left to right and top to bottom always irrespective of whether the fields are in multiple subscreens/tab pages?. Is there a way to control the tab navigation sequence in Screens. Any help regarding this would be appreciated.
    TIA,
    Sharath

    Hi,
    The navigation sequence in tabstrip can be controlled in coding itself.
    If u want to make the first tab as deault u can set that in coding as follows.
    I will give u some sample coding try this out.
    DATA FOR TABSTRIP 'MAIN_TAB'
    CONTROLS:  main_tab TYPE TABSTRIP.
    DATA:      BEGIN OF i_main_tab,
                 subscreen   LIKE sy-dynnr,
                 prog        LIKE sy-repid VALUE
                                  'Program name',
                 pressed_tab LIKE sy-ucomm,
                            <b>"  VALUE c_main_tab-tab1,(specify the tab u want to make default)</b>
               END OF i_main_tab.
    U can control the tab flow in the PBO as
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_9001.
      MODULE main_tab_active_tab_set.
      CALL SUBSCREEN main_tab_sca
        INCLUDING i_main_tab-prog i_main_tab-subscreen.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_9001.
      MODULE main_tab_active_tab_get.
      MODULE main_tab_active_tab_set.
    MODULE main_tab_active_tab_set OUTPUT.
    IF ( NOT cb_det IS INITIAL ) AND
         ( i_main_tab-pressed_tab NE c_main_tab-tab1 ) .
       i_main_tab-pressed_tab = c_main_tab-tab2.
    elseif ( NOT cb_det IS INITIAL ) AND
         ( i_main_tab-pressed_tab eq c_main_tab-tab1 ) .
       i_main_tab-pressed_tab = c_main_tab-tab1.
    ELSEIF ( cb_det IS INITIAL ) AND
         ( i_main_tab-pressed_tab NE c_main_tab-tab2 ).
       i_main_tab-pressed_tab = c_main_tab-tab1.
    ELSEIF ( cb_det IS INITIAL ) AND
         ( i_main_tab-pressed_tab eq c_main_tab-tab2 ).
       i_main_tab-pressed_tab = c_main_tab-tab2.
    ENDIF.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
          i_main_tab-subscreen = '9100'.
          CALL METHOD o_alvgrid1->set_table_for_first_display
          EXPORTING
        WHEN c_main_tab-tab2.
      To display detail report
          i_main_tab-subscreen = '9200'.
          CALL METHOD o_alvgrid2->set_table_for_first_display
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 " MAIN_TAB_ACTIVE_TAB_SET  OUTPUT
    *&      Module  MAIN_TAB_ACTIVE_TAB_GET  INPUT
          text
    MODULE main_tab_active_tab_get INPUT.
      CASE sy-ucomm.
        WHEN c_main_tab-tab1.<b>(tab name)</b>
          i_main_tab-pressed_tab = c_main_tab-tab1.
        WHEN c_main_tab-tab2.
          i_main_tab-pressed_tab = c_main_tab-tab2.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.              " MAIN_TAB_ACTIVE_TAB_GET  INPUT
    &----&      Module  USER_COMMAND_9001  INPUT
          This performs PAI
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          PERFORM exit_program.
          SET SCREEN '0'.
        WHEN 'EXIT' OR  'CANC'.
          PERFORM exit_program.
          LEAVE PROGRAM.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  MAIN_TAB_ACTIVE_TAB_SET  INPUT
          text
    MODULE main_tab_active_tab_set INPUT.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
          i_main_tab-subscreen = '9100'.
        WHEN c_main_tab-tab2.
          i_main_tab-subscreen = '9200'.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.              " MAIN_TAB_ACTIVE_TAB_SET  INPUT
    This is the sample code u can try this out.
    Thanks &  Regards,
    Judith

  • Tab canvas, tabs navigation

    In my tab canvas, for some reason, I had to make my tab1 as tab3 now. I want the users to be able to navigate
    in the normal order tab1,2,3 (as they are laid out in the object navigator). Now that I renamed my tab1 as 3, upon entering the block it is first navigating to tab3.
    Is there a way/place to specify the order or tab navigation at design time?
    Thanks,
    Chiru

    Now that I renamed my tab1 as 3, upon entering the block it is first navigating to tab3.The form doesn't navigate to a tab, it navigates to the "focused" item, means the item where the cursor is placed on. So, if you want another tab to shown by default, you have to order the items in your block so that the first navigable item is visible on tab1.

  • Tabs to tab navigator at runtime

    Hi,
    I want to add 4-5 tabs to a tab navigator at runtime and each
    tab should have a datagrid and 9-10 textinputs in it
    is it possible in flex to do with for loop to add tabs and
    datagrid and text inputs to it
    plz find me some solution

    Given that you had a tab navigator declared in mxml like
    this:
    <mx:TabNavigator id="myTabber" selectedIndex="0">
    </mx:TabNavigator>
    you should just be able to call the addChild method, passing
    the child tab containers. So for example, in some ActionScript
    event handler:
    var newTab:Canvas = new Canvas();
    myTabber.addChild(newTab);
    bear in mind I haven't done this by adding tabs, but have
    done tons with adding controls to an application at runtime using
    this method (DataGrids, Grid, GridItems, etc...)
    Jason

  • Adding tabs dynamically at runtime for a tab navigator control

    Hi,
    Is it possible in flex builder 2 to dynamically add the tabs
    at runtime to the tab navigator control, if we can add plz tell the
    procedure to do that
    thanks in advance

    Given that you had a tab navigator declared in mxml like
    this:
    <mx:TabNavigator id="myTabber" selectedIndex="0">
    </mx:TabNavigator>
    you should just be able to call the addChild method, passing
    the child tab containers. So for example, in some ActionScript
    event handler:
    var newTab:Canvas = new Canvas();
    myTabber.addChild(newTab);
    bear in mind I haven't done this by adding tabs, but have
    done tons with adding controls to an application at runtime using
    this method (DataGrids, Grid, GridItems, etc...)
    Jason

  • #TAB_LINK# value not set for tabbed navigation list

    I'm a big supporter of searching the threads for an answer before posting. My apologies if I've overlooked this in the threads.
    Like many others, I'm leveraging lists to mimic third level tab functionality. I'm trying to use the tabbed navigation list template. My targets for the list entries are pages within the application. When clicking the links however, #TAB_LINK# is not being interpreted within the link URL. #TAB_LINK# is simply appended to the end of the URL instead of being replaced with the actual link value, for example I would expect to see a typical htmldb page link with the target page value.
    As a result, no navigation occurs to the target page. If I change the list template to horitzontal link list, the links function as expected, however I prefer the look of the tabbed navigation template.
    Any suggestions?
    David

    I took a hint from my own post and checked the template that was working for me and noticed that the horizontal list template uses #LINK# instead of #TAB_LINK#.
    I altered the tabbed navigation list template, replacing #TAB_LINK# with #LINK#, and now the tab links function as expected. I'm not sure if this fix will bite me later, or if this is a known issue. If there is a "proper" solution out there, I would still like to hear it. For now I'll assume my fix is a hack.
    Thanks,
    David

  • Adding a same component in each tab of super tab navigator creates problem

    When a UI component is created once and added to each tab using super tab navigator in AS 3.0, the component is adding only to the last index of the tab. The component is missing in the previous tab.
    I have given the code below. Please help me why this is happening and the solution for this.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
            xmlns:mx="http://www.adobe.com/2006/mxml"
            creationComplete="createSuperTabNav()">
            <mx:Script>
                    <![CDATA[
                        import mx.core.UIComponent;
                            import com.tab.navigator.components.SuperTabBar;
                            import com.tab.navigator.components.SuperTabReorderEvent;
                            import com.tab.navigator.components.SuperTab;
                            import com.tab.navigator.components.SuperTabNavigator;
                            import com.tab.navigator.components.ButtonScrollingCanvas;
                            import mx.controls.Label;
                            import mx.controls.Button;
                            import mx.controls.Spacer;
                            import mx.containers.VBox;
                            import mx.containers.HBox;
                            import mx.containers.Canvas;                       
                            import mx.containers.Panel;
                            import mx.core.ScrollPolicy;
                            import mx.core.UIComponent;
                            import flash.events.MouseEvent;
                            public var _tabs : SuperTabNavigator;
                            public var _addBtn : Button;
                            public var _vbox:VBox;
                            public var pageCount:uint;
                            public var tabID:String;
                            private var _comp:UIComponent;
                            public function createSuperTabNav():void
                                _vbox = new VBox();
                                _vbox.percentWidth = 75;
                                _vbox.percentHeight = 75;   
                                _vbox.setStyle("horizontalAlign","center");   
                                _vbox.setStyle("verticalGap", 20);               
                                createTabs();
                                createAddButton();
                                addChild(_vbox);
                            public function createTabs():void
                                _tabs = new SuperTabNavigator();
                                //initTabs();
                                addObjectTab();
                                // Set Properties               
                                _tabs.id = "nav";
                                _tabs.percentHeight = 75;
                                _tabs.percentWidth = 50;
                                _vbox.addChild(_tabs);
                            public function addTab(lbl:String, navigator:SuperTabNavigator, component:UIComponent, getId:String) : Canvas
                                // Create canvas to put into tab
                                var child:Canvas = new Canvas();
                                child.percentHeight = 100;
                                child.percentWidth = 100;
                                child.id = getId;
                                child.label = lbl;
                                child.setStyle("closable", true); 
                                child.addChild(component);  
                                child.setStyle("backgroundColor",0xF8F8F8);
                                navigator.addChild(child);
                                 //trace(_tabs.selectedChild.getChildren().toString());
                                _tabs.reorderTabList();
                                return child;
                            public function createAddButton():void
                                _addBtn = new Button()
                                _addBtn.label = "Add Tab";
                                _addBtn.id = "addTabBtn";
                                _addBtn.width = 75;
                                _addBtn.height = 20;
                                _addBtn.addEventListener(MouseEvent.CLICK, handleButtonClick,false,0, true);
                                _vbox.addChild(_addBtn);
                            public function handleButtonClick(evt:MouseEvent):void
                                //addTab('tab '+Number(_tabs.numChildren + 1), _tabs);
                                addObjectTab();
                                _tabs.selectedIndex = _tabs.numChildren - 1;
                            public function addObjectTab():void
                                var frameCanvas:Canvas = new Canvas();           
                                frameCanvas.horizontalScrollPolicy = ScrollPolicy.OFF;
                                frameCanvas.verticalScrollPolicy = ScrollPolicy.OFF;
                                frameCanvas.percentHeight = 100;
                                frameCanvas.percentWidth = 100;
                                if ( _comp == null )
                                    _comp = addComponent();   
                                frameCanvas.addChild(_comp);
                                // Create container to implement horizontal padding
                                var horizontalPadder:HBox = new HBox();           
                                horizontalPadder.setStyle("backgroundAlpha", 0);
                                horizontalPadder.horizontalScrollPolicy = ScrollPolicy.OFF;
                                horizontalPadder.verticalScrollPolicy = ScrollPolicy.OFF
                                horizontalPadder.addChild(new Spacer());
                                horizontalPadder.addChild(frameCanvas);
                                horizontalPadder.addChild(new Spacer());
                                // Create container to implement vertical padding
                                var verticalPadder:VBox = new VBox();           
                                verticalPadder.setStyle("backgroundAlpha", 0);
                                verticalPadder.horizontalScrollPolicy = ScrollPolicy.OFF;
                                verticalPadder.verticalScrollPolicy = ScrollPolicy.OFF
                                verticalPadder.addChild(new Spacer());
                                verticalPadder.addChild(horizontalPadder);
                                verticalPadder.addChild(new Spacer());
                                // Position padder
                                verticalPadder.setStyle("horizontalAlign", "Left");
                                verticalPadder.x = 0
                                verticalPadder.y = 0;
                                tabID = "page"+ _tabs.getNumberOfTabs()+1;
                                var canvas:Canvas = addTab("Page "+(_tabs.getNumberOfTabs()+1), _tabs ,verticalPadder, tabID);
                                canvas.setStyle("backgroundColor", "#009900");
                            public function addComponent():UIComponent
                                var pageCount:uint = _tabs.getNumberOfTabs()+1;
                                var page:Canvas = new Canvas;
                                 page.width = 250;
                                 page.height = 250;
                                 page.setStyle("backgroundColor", "#FFFFFF");
                                var _pageBtn:Button = new Button();
                                _pageBtn.label = "Button "+(pageCount);
                                _pageBtn.id = "addTabBtn "+(pageCount);
                                _pageBtn.width =100;
                                _pageBtn.height = 20;
                                page.addChild(_pageBtn);
                                return page;
                    ]]>
            </mx:Script>
    </mx:Application>

    Adding an instance moves it, it does not copy it.

  • Tab Navigator not loading all tabs at start

    I have a tab navigator with a dataGrid in one tab and another
    dataGrid in another and when I double click the dataGrid in tab 1 I
    want it to go to tab 2 and set the selected item or dataGrid1 to
    dataGrid2. The problem is when I double click on the dataGrid, and
    havent navigated to tab 2 before. This gives "TypeError: Error
    #1009: Cannot access a property or method of a null object
    reference." The tabNavigator's creationPolicy="all" and the
    function that is called on doubleClick is
    private function GotoNext():void{
    if(firstDataGrid.selectedItem!=null){
    myTabNavigator.selectedIndex=1;
    secondDataGrid.selectedItem=firstDataGrid.selectedItem;
    This works if I first click on the 2nd tab then click back on
    the 1st tab, but not if I just double click.
    Any help would be appreciated.
    Thanks,
    Chris

    quote:
    Originally posted by:
    cjwprostar.
    ... The tabNavigator's creationPolicy="all" and ...
    Here's a working example that has this problem..
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    public var xmlOne:XML=
    <root>
    <data>
    <name>Foo</name>
    <type>Number</type>
    </data>
    <data>
    <name>Bar</name>
    <type>String</type>
    </data>
    </root>;
    public var xmlTwo:XML=
    <root>
    <data>
    <name>Foo</name>
    <type>Number</type>
    </data>
    <data>
    <name>Bar</name>
    <type>String</type>
    </data>
    </root>;
    [Bindable]
    public var sourceOne:XMLListCollection=new
    XMLListCollection(new XMLList(xmlOne));
    [Bindable]
    public var sourceTwo:XMLListCollection=new
    XMLListCollection(new XMLList(xmlTwo));
    public function GotoNext():void{
    if(dgOne.selectedItem!=null){
    tabNav.selectedIndex=1;
    trace(dgOne.selectedItem);
    trace(dgTwo.selectedItem);
    dgTwo.selectedItem=dgOne.selectedItem;
    trace(dgTwo.selectedItem);
    trace("--------------------------");
    ]]>
    </mx:Script>
    <mx:TabNavigator id="tabNav" creationPolicy="all"
    left="20" right="20" top="20" bottom="20">
    <mx:Panel id="tabOne" label="Tab 1" width="100%"
    height="100%">
    <mx:DataGrid dataProvider="{sourceOne.child('data')}"
    width="100%" height="100%" doubleClickEnabled="true" id="dgOne"
    doubleClick="GotoNext();">
    <mx:columns>
    <mx:DataGridColumn headerText="Column 1"
    dataField="name"/>
    <mx:DataGridColumn headerText="Column 2"
    dataField="type"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Panel>
    <mx:Panel id="tabTwo" label="Tab 2" width="100%"
    height="100%">
    <mx:DataGrid dataProvider="{sourceOne.child('data')}"
    id="dgTwo" width="100%" height="100%">
    <mx:columns>
    <mx:DataGridColumn headerText="Column 1"
    dataField="name"/>
    <mx:DataGridColumn headerText="Column 2"
    dataField="type"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Panel>
    </mx:TabNavigator>
    </mx:Application>

  • Tab Navigator

    I have problem in giving roll over color for a Tab
    Navigator.I have tried with setting styles such as fillcolors,roll
    over color but not achieved yet. Any suggestions will be accepted.
    Thanks in advance.

    Hello.
    That might be skins. upSkin, downSkin, overSkin ...
    More information is here.
    http://livedocs.adobe.com/flex/201/langref/mx/containers/TabNavigator.html
    Also I made a sample of Vertical TabNavigator.
    This sample use TabBar. But skins are same as TabNavigator.
    http://shigeru-nakagaki.com/index.cfm/2007/8/21/20070821-Vertical-TabNavigator-sample
    Shigeru

Maybe you are looking for