Tabnavigator selectedIndex issue

I have a TabNavigator. The script controlling portion of it is:
            private function init():void{
                tabNavBar.selectedIndex = 2;
this works fine as the third tab is selected upon creationComplete of the component.
However, if I send in an int via scripting, nothing changes.
            public function changeTab( e:FormEvent ):void {
                Alert.show("Event value passed in is " + e.tabIndex.toString());           // Alerts Event value passed in is 0
                Alert.show("Starting value is " + tabNavBar.selectedIndex.toString());  // Alerts starting value is -1 (no children??)
                tabNavBar.selectedIndex = e.tabIndex;
                Alert.show("Tab is now" + tabNavBar.selectedIndex.toString());          // Alerts Tab is now 0 (correct but doesn't change)
Things I've tried:
validateNow();
int(e.tabIndex)
e.tabIndex as int;
Other suggestions?
Thanks.

Hi,
the following code changes the tabnavigator programmatically, when you press the tabbar the change event then sets the tabnavigator to match . When you set the selected index it should just work, are you doing this from a popup window as that may have an effect on how the component updates(note: I'm using the latest sdk).
you could try setting the update flag(this shouldn't really have any effect), tabnav.updateCompletePendingFlag=true; but without the full code its hard to say what the problem is.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
   creationComplete="application1_creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
import spark.events.IndexChangeEvent;
[Bindable] private var myArr:ArrayCollection = new ArrayCollection(['1','2','3']);
protected function application1_creationCompleteHandler(event:FlexEvent):void
tabnav.selectedIndex = 1;
protected function buttonbar1_changeHandler(event:IndexChangeEvent):void
tabnav.selectedIndex = event.newIndex;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:TabNavigator id="tabnav" x="174" y="191" width="579" height="254">
<s:NavigatorContent label="Tab 1" width="100%" height="100%">
</s:NavigatorContent>
<s:NavigatorContent label="Tab 2" width="100%" height="100%">
</s:NavigatorContent>
<s:NavigatorContent label="Tab 3" width="100%" height="100%">
</s:NavigatorContent>
</mx:TabNavigator>
<s:ButtonBar x="204" y="78" dataProvider="{myArr}" change="buttonbar1_changeHandler(event)"/>
</s:Application>

Similar Messages

  • TabNavigator.selectedIndex problem

    What I'm trying to do, is some data validation before allowing a user to change tabs, so I put some code in the change handler on the tabNavigator, which fires when a user clicks another tab. If the validation fails, then the code sets the selectedIndex back to the index of the previous tab.
    This all works fine, but for some reason, the tab which was clicked on becomes a "dead" tab, and no longer fires a change event when clicked on. Anyone know what is happening here, or a way to correct this issue?
    I've tried tabNavigator.validateNow(), but that didn't seem to do much.
    Many thanks!

    Thanks for your input David. Basically, the client wants the app to check to make sure a user has entered certain data before allowing them to leave the current tab. The action the user takes, will be clicking on another tab, so the change event seems like the only place I can capture this action and alert the user they need to do something.
    Here is an example of what the code looks like:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml">
         <mx:Script>
              <![CDATA[
              import  mx.events.FlexEvent;
              import  mx.events.IndexChangedEvent;
              protected function handleTnChange(e:Event):void
                   var failed:Boolean = true;
                   //Assume validation failed for test
                   if (failed) {
                        tn.selectedIndex = _tnSelectedIndex; //tnSelectedIndex holds the previous selected tab index before the user click
                   else{
                        //Proceed to the selected tab
         ]]>
         </mx:Script>
         <mx:TabNavigator  id="tn" change="handleTnChange(event)">
              <mx:Canvas label="Tab 1"  width="100%" height="100%">
              </mx:Canvas>
              <mx:Canvas label="Tab 2" width="100%" height="100%">
              </mx:Canvas>
              <mx:Canvas label="Tab 3" width="100%" height="100%">
              </mx:Canvas>
         </mx:TabNavigator>
    </mx:Application>
    So, assuming the user is on Tab 1, and clicks Tab 2, what is happening is the selectedIndex gets changed back to Tab 1 in the change function, but Tab 2 seems to become "dead", so that when the user clicks on Tab 2 again, it doesn't fire a change event.
    Something I noticed while trying to figure out the problem, is that on the mouse down event when clicking a tab, the change fires, and the tab changes, but on the mouse up, the tabNavigator seems to come back, at least the tab itself, to the tab that was originally clicked before the selectedIndex was changed.
    Anyway, hope this clears up what I'm trying to do.
    Thanks!

  • TabNavigator performance issue

    Hi,
    I am using a TabNavigator with performance-wise expensive
    tabs. I was wondering if it is possible if it is possible to
    improve performance of a TabNavigator by having only one actual
    visual child and update the child with the selected tab-data as the
    user selects a different tab, similar as using a List with an
    ItemRenderer.
    Thank you,
    Andrej

    "mavdzee" <[email protected]> wrote in
    message
    news:gofomq$7aa$[email protected]..
    > Hi,
    >
    > I am using a TabNavigator with performance-wise
    expensive tabs. I was
    > wondering if it is possible if it is possible to improve
    performance of a
    > TabNavigator by having only one actual visual child and
    update the child
    > with
    > the selected tab-data as the user selects a different
    tab, similar as
    > using a
    > List with an ItemRenderer.
    This example shows doing what you're asking with an
    Accordion, which works
    pretty much in the same way:
    http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html

  • TabNavigator selectedIndex not working

    I have reduced a problem I'm having to a very simple example.
    I'm using the routine in a validation of form, trying to make sure
    they don't leave the current tab index if a form is 'open.' It
    works the first time but after that, does not work every other
    time. Suggestions?

    I ran into a similar problem where the correct tab was not
    always being selected when the ViewStack selectedIndex changed.
    This is a bug in Flex, which I have reported and submitted a patch
    for.
    In the meantime, you can use the attached Custom Class, and
    this should fix your problem....

  • CFFORM and tabs

    I have a flash form with multiple tabs. When the user clicks
    the Submit button, I want the form to reload with the same tab on
    top.
    Example: There are two tabs: "Car" and "House". "Car" is the
    top tab. If the user hits submit while on the "House" tab, I want
    the page to reload with the "House" tab selected. Thank
    you!!

    This might not be the best solution, but it works:
    <!--- set default tab to 0 --->
    <cfparam name="thisTab" default="0">
    <!--- selectedindex tells the form which tab to focus on
    --->
    <cfformgroup type="TabNavigator" selectedindex="#thisTab#"
    id="tabs">
    <!--- create a hidden form field and populate it with the
    currently selected tab's index --->
    <cfinput type="hidden" name="thisTab" value="">
    <cfinput type="submit" name="Submit" value="Submit"
    onClick="theForm.thisTab = tabs.selectedIndex;">

  • TabNavigator Child Control Problem on Programmatic SelectedIndex Change

    I've got a TabNavigator that contains another TabNavigator as
    a child control on its second page. On the child TabNavigator
    there's a ViewStack and a couple of Accordion controls. On my first
    parent tab I've got a Button that, when clicked, programmatically
    changes the selectedIndex of the parent TabNavigator to display the
    contents of the second tab (which contains the child TabNavigator).
    I'm finding that when the index of the TabNavigator is
    changed programmatically, all of the controls in the child
    TabNavigator are stacked on top of each other and overlapping as
    though the Flash player has no clue how to display these child
    controls. Once I click through each tab on the child TabNavigator,
    they appear intact. If I click the Button to change the tab again,
    all of the controls will be jumbled and stacked.
    This problem happens 100% of the time. I've changed every
    single control in my app to creationPolicy="all" to no avail.
    Anybody experienced this or know what to do?

    I've got a TabNavigator that contains another TabNavigator as
    a child control on its second page. On the child TabNavigator
    there's a ViewStack and a couple of Accordion controls. On my first
    parent tab I've got a Button that, when clicked, programmatically
    changes the selectedIndex of the parent TabNavigator to display the
    contents of the second tab (which contains the child TabNavigator).
    I'm finding that when the index of the TabNavigator is
    changed programmatically, all of the controls in the child
    TabNavigator are stacked on top of each other and overlapping as
    though the Flash player has no clue how to display these child
    controls. Once I click through each tab on the child TabNavigator,
    they appear intact. If I click the Button to change the tab again,
    all of the controls will be jumbled and stacked.
    This problem happens 100% of the time. I've changed every
    single control in my app to creationPolicy="all" to no avail.
    Anybody experienced this or know what to do?

  • Loading time issue

    hi,
    I have an issue with loading custom compont based on title window.
    Problem is creating component take too many large time.
    This component based on TitleWindow.
    And it included
    1.HBox which contain 15 buttons(actually it is also an separate component)
    2.TabNavigator which contain 9 tabs(7 of them are custom components)
    I have use creation policy all for the tabnavigator,because I can't perform my logic using on demand creation policy.
    Note:
    If I use creation policy auto,then I can't perform my logic.
    eg:cann't call reset methods of components, because sometimes,If I I didn't navigate then it has not been created and Object reference is null.then cann't help.
    component is very reusable in my system.But it takes too many time to load.
    What can I do? Any suggessons?

    If you want to go down the creation policy route, set the creation policy to NONE, the use the initialize methods to create them when you have data.
    I have a similar project (some code below). In the main <mx:Application/> block, I have a preinitialize method that gets the initial data, the one that is good for tabone then call VSMain.initialize(). This creates the viewstack but only TabOne. The others are created when they are accessed for the first time.
    <mx:VBox width="990" paddingLeft="0" paddingRight="0" horizontalCenter="0" height="570" horizontalScrollPolicy="off" verticalScrollPolicy="off">
    <mx:ViewStack id="VSMain" width="990" height="570" selectedIndex="0" creationPolicy="none">
         <s:NavigatorContent id="one" label="One">
              <main:TabOne/>
         </s:NavigatorContent>
         <s:NavigatorContent id="two" label="Two" creationPolicy="none">
              <main:TabTwo />
         </s:NavigatorContent>
         <s:NavigatorContent id="three" label="Three" creationPolicy="none">
              <main:TabThree/>
         </s:NavigatorContent>
    </mx:ViewStack>
    </mx:VBox>

  • Datagrid scrollToIndex issue

    Hi All,
    I have a tab navigator with 3 canvas, in each canvas I have a datagrid displaying the same record id's with some different data. If i click in one of the datagrid row I am selecting the same index row in the other two datagrids.
    My issue is when I select a row using high number with scroll. To show the same row in the other two datagrids I am using scrollToIndex but the it is not working until I select the datagrid first, after that it works fine.
    I try using validateNow() like this example but no luck:
    http://www.anujgakhar.com/2007/12/28/flex-how-to-pre-select-an-item-in-datagrid/
    Any ideas?
    Thanks
    JFB

    Hi Alex,
    I did create a test with structure of my app and it works fine after setting creationPolicy all in the tab navigator.
    I try the same in my main app and it is not working , I try setting creationPolicy in all tab navigators and no luck, still the same, it works after selecting the other datagrids.
    How can I debug this issue?
    Thanks for you reply and help.
    JFB
    Here is my test code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.events.ListEvent;
                [Bindable] private var acSample2:ArrayCollection = new ArrayCollection;
                private var TotalTYCOM:Number = 0;
                [Bindable] private var acSample:ArrayCollection = new ArrayCollection([
                    {Fname: "Kranthi", Lname:"Kata", dob:"21/10/1972", Amount:10000, Rate:0},
                    {Fname: "Vasanth", Lname:"Lola", dob:"12/01/1980", Amount:5000, Rate:0},
                    {Fname: "Sample1", Lname:"Lola", dob:"12/01/1982", Amount:10000, Rate:0},
                    {Fname: "Basanth", Lname:"Viola", dob:"5/01/1980", Amount:5000, Rate:0},
                    {Fname: "Sample2", Lname:"Viola", dob:"2/06/1985", Amount:10000, Rate:0},
                    {Fname: "Manoj", Lname:"Pati", dob:"16/09/1978", Amount:5000, Rate:0},
                    {Fname: "John McClain", Lname:"Mela", dob:"15/01/1974", Amount:10000, Rate:0},
                private function setADGRow(event:ListEvent):void{
                    var rowIndex:Number = event.rowIndex;
                    total_dg.selectedIndex = rowIndex;
                    first_dg.selectedIndex = rowIndex;
                    second_dg.selectedIndex = rowIndex;
                    total_dg.validateNow();
                    first_dg.validateNow();
                    second_dg.validateNow();
                    total_dg.scrollToIndex(rowIndex);
                    first_dg.scrollToIndex(rowIndex);
                    second_dg.scrollToIndex(rowIndex);
            ]]>
        </mx:Script>
        <mx:TitleWindow width="100%" height="100%" layout="absolute" title="Summary" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
            <mx:TabNavigator id="firstLevel" width="100%" height="100%">
                <mx:Canvas id="one" label="ONE" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
                </mx:Canvas>
                <mx:Canvas id="two" label="TWO" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
                </mx:Canvas>
                <mx:Canvas id="three" label="THREE" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
                    <mx:TabNavigator width="100%" height="100%">
                        <mx:Canvas id="AA_ONE" label="FIST" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:TabNavigator id="firstTabNav" width="100%" height="100%" creationPolicy="all" >
                                <mx:Canvas label="Totals" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                </mx:Canvas>
                                <mx:Canvas label="First" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                </mx:Canvas>
                                <mx:Canvas label="Second" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                </mx:Canvas>
                            </mx:TabNavigator>
                        </mx:Canvas>
                        <mx:Canvas id="AA_TWO" label="SECOND" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:TabNavigator id="secondTabNav" width="100%" height="100%" creationPolicy="all" >
                                <mx:Canvas label="Totals" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                    <mx:AdvancedDataGrid id="total_dg" dataProvider="{acSample}" x="10" y="10" width="890" height="150" editable="false" itemClick="setADGRow(event)"
                                                         sortableColumns="false" headerHeight="40" lockedColumnCount="1" >
                                        <mx:columns>
                                            <mx:AdvancedDataGridColumn headerText="FIRST NAME" dataField="Fname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="LAST NAME" dataField="Lname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="DOB" dataField="dob" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="TOTAL" dataField="Amount" width="100" textAlign="right" />
                                        </mx:columns>
                                    </mx:AdvancedDataGrid>
                                </mx:Canvas>
                                <mx:Canvas label="First" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                    <mx:AdvancedDataGrid id="first_dg" dataProvider="{acSample}" x="10" y="10" width="890" height="150" editable="false" itemClick="setADGRow(event)"
                                                         sortableColumns="false" headerHeight="40" lockedColumnCount="1" >
                                        <mx:columns>
                                            <mx:AdvancedDataGridColumn headerText="FIRST NAME" dataField="Fname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="LAST NAME" dataField="Lname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="DOB" dataField="dob" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="TOTAL" dataField="Amount" width="100" textAlign="right" />
                                        </mx:columns>
                                    </mx:AdvancedDataGrid>
                                </mx:Canvas>
                                <mx:Canvas label="Second" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                    <mx:AdvancedDataGrid id="second_dg" dataProvider="{acSample}" x="10" y="10" width="890" height="150" editable="false" itemClick="setADGRow(event)"
                                                         sortableColumns="false" headerHeight="40" lockedColumnCount="1" >
                                        <mx:columns>
                                            <mx:AdvancedDataGridColumn headerText="FIRST NAME" dataField="Fname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="LAST NAME" dataField="Lname" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="DOB" dataField="dob" width="150" />
                                            <mx:AdvancedDataGridColumn headerText="TOTAL" dataField="Amount" width="100" textAlign="right" />
                                        </mx:columns>
                                    </mx:AdvancedDataGrid>
                                </mx:Canvas>
                            </mx:TabNavigator>
                        </mx:Canvas>
                    </mx:TabNavigator>
                </mx:Canvas>
            </mx:TabNavigator>
        </mx:TitleWindow>
    </mx:Application>

  • TabNavigator blinking

    Anyone else seeing this issue? Create a tab navigator inside a popup, put in 3 tabs and inside each of those three tabs (vboxs) put <canvas><Vgroup><Hgroup>bunch of components</Hgroup></group></canvas>.
    When you run the app and the popup is displayed you are tab #1, click tab #3 and for me if the mouse is over the tab #3 when it opens the content will blink continously until you move your mouse of the selected tab ( off screen ).  If you leave the mouse over tab #3 it will blink forever until you remove your mouse.
    So to work around I tried createpolicy="all" so that the creation is all done at once for all tabs. The only issue I have a dropdownlist that should be populated in tab#3 but when you creationpolicy="true" and you move from tab#1 to tab#3 the dropdowlist will empty.  Maybe calling invalidateSize, invalide*..., etc... will work once tab#3 is active? So click tab#3 and when it becomes active have the tab nav change function tell the dropdowlist in tab#3 to in essenance refresh?
    Shouldn't have to do this but then the tab nav shouldn't blink.
    Jason

    dallas,
    Can you please file a bug at http://bugs.adobe.com/flex and include a simple test case.
    I was unable to repro the behavior you describe using the following example:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            xmlns:local="*">
        <s:layout>
            <s:VerticalLayout paddingLeft="20" paddingTop="20"/>
        </s:layout>
        <fx:Script>
            <![CDATA[
                import mx.core.IFlexDisplayObject;
                import mx.managers.PopUpManager;
                protected function btn_clickHandler(event:MouseEvent):void {
                    var poppy:IFlexDisplayObject = PopUpManager.createPopUp(this, TabNav, true);
                    PopUpManager.centerPopUp(poppy);
            ]]>
        </fx:Script>
        <local:TabNav />
        <s:Button id="btn" label="Launchy" click="btn_clickHandler(event)" />
        <mx:Label id="sdkVer" initialize="sdkVer.text = 'Flex SDK Version: ' + mx_internal::VERSION;" />
    </s:Application>
    And my custom TabNav.mxml component/popup is as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TabNavigator name="TabNav"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            width="550" height="400">
        <fx:Script>
            <![CDATA[
                import mx.managers.PopUpManager;
            ]]>
        </fx:Script>
        <mx:Canvas label="Tab Number One">
            <s:VGroup>
                <s:HGroup>
                    <mx:ColorPicker id="cp1"
                            initialize="cp1.selectedIndex = Math.random() * cp1.dataProvider.length;" />
                    <mx:DateChooser baseColor="{cp1.selectedColor}" />
                    <mx:DataGrid baseColor="{cp1.selectedColor}" />
                </s:HGroup>
                <s:Button id="closeBtn"
                        label="Close PopUp"
                        click="PopUpManager.removePopUp(this);"
                        initialize="closeBtn.includeInLayout = this.isPopUp;" />
            </s:VGroup>
        </mx:Canvas>
        <mx:Canvas label="Tab Number Two">
            <s:VGroup>
                <s:HGroup>
                    <mx:DateChooser baseColor="{cp2.selectedColor}" />
                    <mx:DataGrid baseColor="{cp2.selectedColor}" />
                    <mx:ColorPicker id="cp2"
                            initialize="cp2.selectedIndex = Math.random() * cp2.dataProvider.length;" />
                </s:HGroup>
            </s:VGroup>
        </mx:Canvas>
        <mx:Canvas label="Tab Number Three">
            <s:VGroup>
                <s:HGroup>
                    <mx:DataGrid baseColor="{cp3.selectedColor}" />
                    <mx:ColorPicker id="cp3"
                            initialize="cp3.selectedIndex = Math.random() * cp3.dataProvider.length;" />
                    <mx:DateChooser baseColor="{cp3.selectedColor}" />
                </s:HGroup>
            </s:VGroup>
        </mx:Canvas>
    </mx:TabNavigator>
    Peter

  • TabNavigator change

    I employ a TabNavigator container in my site and there are
    three tabs; T1, T2 and T3. When T1 is clicked, I change the
    currentState to S1 and in that window, I have a button "play" which
    when I click, starts a video window and plays a file. Midway thru
    that play back, I click T2 and I have coded it to change state to
    S2. I get my job done in S2 and I click back to T1, it takes me to
    the video playback screen which is playing that file. I want it to
    go to the first state S1 which has a screen that displays the
    "play" button. Can someone help me with this issue? Thanks,
    Ramesh

    Mainmanian - I think that if you are using states that you
    could set the default state in a function based on the
    selectedIndex of the tabNavigator on a change event on the
    tabNavigator. Good Luck.
    I believe I have the same issue. Basically the child objects
    under a TabNavigator page are not reset to their initial state once
    they have been accessed. For example, if there are 2 tabs on the
    tabNavigator - T1 has a canvas with some test objects on it, T2 has
    a canvas with a swf movie on it. When T2 is selected, the swf loads
    and begins playing, then if T1 is selected the text objects are
    viewed, then if T2 is selected again the swf movie is still playing
    as if it had always been selected instead of stopping when focus
    was lost when T1 was selected. Basically, how does one reset the
    contents of a tab to it's original state, so that each time a user
    selects that tab any actions previously taken are lost or reset. In
    my case, the swf movie would reset and start from the beginning. In
    Mainmanian's case, he wants the movie to be removed and the button
    to control reloading it.

  • TabNavigator Not Displaying Tabs

    I have an app whose top-level container is a TabNavigator
    (PARENT). PARENT has one static tab (index 0) and a Repeater bound
    to an Array that dynamically creates the remaining tabs. Clicking a
    button on the first tab adds an item to the Array and updates the
    Repeater. What should happen is this:
    A new tab is added whose content is another TabNavigator
    (CHILD) with four tabs. The selectedIndex of PARENT is updated to
    the newly-added tab and CHILD's selectedIndex is updated based on
    the data contained therein.
    What actually happens is this:
    A new tab is added whose content appears to be a Box with a
    border, but no tabs. Only the content of CHILD's first tab is
    displayed.
    At one point this was working but now it's messed up. I've
    checked all of my code for consistent line endings, etc. The app
    runs perfectly except for this display issue.

    quote:
    Originally posted by:
    ntsiii
    One this I see is that you shuld have:
    AppTabs.selectedIndex = openDeals.length - 1;
    since selectedIndex is zero based.
    Tracy
    The reason I'm using openDeals.length is because the static
    tab takes up index 0 so I need to start at 1 for my new tabs. That
    was purposeful. I'll try the creationPolicy and see what
    happens.

  • TabNavigator ALL tabs unselected

    I am having a problem with the tab navigator. When I clear it
    and repopulated it programmatically, it shows all of the tabs as
    unselected even though it is showing the contexts of the 1st tab.
    I've mocked up a sample that reproduces the issue (see
    below). Open the page and click the Rebuild button. Notice that
    both tabs are showing as unselected. Also note that clicking sel1st
    which sets the selectedIndex to 0 on the tab navigator has no
    effect. It is interesting to note that clicking selLast does work
    and once that is done sel1st also works.
    The problem appears to be caused by removing all of the
    children and the later (after the navigator has redrawn?) adding
    tabs.
    Has anyone seen this problem? Am I missing something?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.containers.Canvas;
    private var num:int = 0;
    private function rebuildTN():void{
    tn.removeAllChildren();
    callLater(addChildren);
    private function addChildren():void{
    var child:Canvas;
    for(var i:int = 0; i < 2; i++){
    child = new Canvas();
    child.label = num.toString();
    num++;
    tn.addChild(child);
    ]]>
    </mx:Script>
    <mx:TabNavigator id="tn" x="88" y="48" width="377"
    height="255">
    <mx:Canvas label="Tab 1" width="100%" height="100%">
    </mx:Canvas>
    </mx:TabNavigator>
    <mx:Button x="253" y="320" label="Rebuild"
    click="rebuildTN();"/>
    <mx:Button x="216" y="350" label="sel1st"
    click="tn.selectedIndex=0;"/>
    <mx:Button x="284" y="350" label="selLast"
    click="tn.selectedIndex=tn.numChildren-1"/>
    </mx:Application>

    How do you close those tabs?
    Firefox 4 and later versions save the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    Use "File > Exit" or "Firefox > Exit" (Mac: "Firefox > Quit Firefox") if you want to restore multiple windows.<br />
    You can use "History > Restore Previous Session" to get the previous session at any time.<br />
    You may need to click the orange/gray Firefox button to see History.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />

  • Issues with AUTO cycling through ....

    I'm trying to do this:
    Any help with one or the other is very much appriciated !!!
    1) When the Timer is finish auto cycling through the tabs (1 to 16) of the ViewStack, and switching over to tab (1) to STOP, I would like to address a function to do something ???
    The question is now how to write the code to ID that the Timer has come to a STOP on tab (1), and how can I incoperate this into the existing (onTimerOne) function.
    2) The second item I'm after is that if I'm amnualy select any tab (1 to 16) to address also a function to do something ???
    3) The third item I'm after is to automaticly zero (0) the ViewStack to tab number (1) if I click a Btn.
    <mx:Script>
    <![CDATA[
        import flash.events.TimerEvent;
        import flash.utils.Timer;
        private var timerOne:Timer;
        private function initOne():void {
            timerOne = new Timer(5000, myViewStack.numChildren);
            timerOne.addEventListener(TimerEvent.TIMER, onTimerOne);
        private function onTimerOne(evt:TimerEvent):void {
            if(myViewStack.selectedIndex == myViewStack.numChildren-1) {
            myViewStack.selectedIndex = 0;
            return;
            myViewStack.selectedIndex++;
        private function autoOne():void {
            if (!timerOne.running) {
            timerOne.start();
        private function manualOne():void {
            if (timerOne.running) {
            timerOne.stop();
    ]]>
    </mx:Script>
    4) Well, the fourth item I'm trying to work out is as I'm reading my data from an Xml file to have a TextArea which shows the different countries from the Xml file for each ViewStack tab while auto cycling through these tabs (1 to 16).
    The diffuculty here is that I use this Xml with a specific urlID="1" to urlId="16" as part shown below.
    <urlsOceania>
        <urlOceania urlID="1"/>
        <searchCountry>American Samoa</searchCountry>
        <etc></etc>
    </urlsOceania>
    I'm reading all the other items this way:
    source="{urlsOceania.urlOceania.(@urID==1).etc}"
    Thanks in advance aktell2007

    Thanks for the confirmation.  7 miles away is most likely using the same VZW tower but it does confirm the problem is not in your current location for us.
    You can look up local tower locations from many public websites such as the following:
    www.antennasearch.com
    www.cellreception.com
    http://www.evdoinfo.com/content/view/2990/63/
    The signal of -65 shows you have strong reception but it doesnt show the entire picture.  Your tower could be overloaded or unauthenticating you.  There are lots of little issues that exist outside of the raw signal strength between the towers and the connecting devices that we users have no control over.  As you may guess only a tower tech has access to identify and correct these things.
    Based on the picture of the back of the MBR1515/Netgear N300 router from Netgear I would assume that only a normal sized SIM card will fit.  I would not assume a micro SIM card will fit.  Since I do not have access to either of the VZW or non-VZW 4G LTE router I cannot confirm if it will work or not.  You might have to give Netgear a call and ask.  Based on what I can see from the User Guides of both devices the SIMs used for each should be compatible with eachother.
    If you decide to purchase the non vzw version please post back your findings for us.

  • How can I initialize all TabNavigator Tabs upon a state change?

    Here's the basic goal. I want to provide two views to the
    user that display the same panels. I configured each view as a
    separate state but I am having trouble initializing each of the tab
    views since they are only created by Flex when the user first
    selects it. I need them all created when the user changes to that
    state so that I can insert my view objects. Does that make sense?
    Ok, how about an example program. I define three view objects
    in ActionScript which will be used in two different states. I use
    AddChild to put them in the proper layout location. The problem is
    with the Tab state. The AddChild operation only works for the first
    tab because it is visible. The other two tabs don't get setup
    properly. Can anyone help me resolve this?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="onCreationComplete()">
    <mx:Script>
    <![CDATA[
    import mx.containers.VBox;
    import mx.controls.Label;
    [Bindable] public var view1:VBox;
    [Bindable] public var view2:VBox;
    [Bindable] public var view3:VBox;
    private function onCreationComplete():void
    var label1:Label = new Label();
    var label2:Label = new Label();
    var label3:Label = new Label();
    label1.text = "This is view 1.";
    label2.text = "This is view 2.";
    label3.text = "This is view 3.";
    view1 = new VBox();
    view1.label = "View 1";
    view1.addChild(label1);
    view2 = new VBox();
    view2.label = "View 2";
    view2.addChild(label2);
    view3 = new VBox();
    view3.label = "View 3";
    view3.addChild(label3);
    currentState = "wizardState";
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = 'wizardState'; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320"/>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="wizardState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:HBox width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"/>
    </mx:HBox>
    </mx:AddChild>
    <mx:AddChild target="{view1}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view2}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view3}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    </mx:State>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabViewStack" width="100%"
    height="100%">
    <mx:VBox label="Tab 1" id="tab1"/>
    <mx:VBox label="Tab 2" id="tab2"/>
    <mx:VBox label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"
    position="lastChild"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"
    position="lastChild"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"
    position="lastChild"/>
    </mx:State>
    </mx:states>
    </mx:Application>

    Ok, here is an even simpler scenario. I take each view from
    the default state and put them in the new tab view when the state
    changes. If you compile and run this example, the only view that
    makes it into the tabview is the one that was active when the state
    changed. Why is that?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = ''; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320">
    <mx:HBox id="wizardView" width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"
    creationPolicy="all">
    <mx:Canvas id="view1" label="Part 1" >
    <mx:TextInput text="This is view 1"/>
    </mx:Canvas>
    <mx:Canvas id="view2" label="Part 2">
    <mx:TextInput text="This is view 2"/>
    </mx:Canvas>
    <mx:Canvas id="view3" label="Part 3">
    <mx:TextInput text="This is view 3"/>
    </mx:Canvas>
    </mx:ViewStack>
    </mx:HBox>
    </mx:Panel>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabView" width="100%" height="100%"
    creationPolicy="all">
    <mx:Canvas label="Tab 1" id="tab1"/>
    <mx:Canvas label="Tab 2" id="tab2"/>
    <mx:Canvas label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:RemoveChild target="{view1}"/>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"/>
    <mx:RemoveChild target="{view2}"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"/>
    <mx:RemoveChild target="{view3}"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"/>
    <mx:RemoveChild target="{wizardView}"/>
    </mx:State>
    </mx:states>
    </mx:Application>

  • Flex 3 TabNavigator getting tab name when tab clicked

    Hi All, I am using Flex 3.
    I have <mx:TabNavigator  id="dbtabs" width="100%" height="100%" click="changeTabs()"  />
    I am also adding tabs dynamically. 
    In the grand scheme of things, I want to let a user add tabs as needed and chose what content is on the tab.  This is saved data, so when they come back I need to reload their saved settings.
    What I am trying to do is find out how to get the index of the tab when it is clicked. Right now I have to click the tab then click in the vbox to get the selectedIndex.  Is there a way to get the selectedIndex as soon as the tab is clicked?
    Thanks.

    private function handleTabClick(evt:IndexChangedEvent):void
           var i:int = evt.newIndex;
    <mx:TabNavigator change="handleTabClick(event)">
            <mx:Canvas width="200" height="200" label="Tab 1"/>
            <mx:Canvas width="200" height="200" label="Tab 2"/>
    </mx:TabNavigator>
    Dany

Maybe you are looking for