cheerq / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

Closable tabs throw errors. #100

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a series of closable tabs in a supertabnavigator
2. Remove one of them.
3. Hit the back button on your browser for a while.  Eventually it will error.

What is the expected output? What do you see instead?
It should not through the error.

What version of the product are you using? On what operating system?
Flex 3.0, Windows, Firefox, IE 7

Please provide any additional information below.

Original issue reported on code.google.com by jonno...@gmail.com on 12 Mar 2008 at 4:37

GoogleCodeExporter commented 8 years ago
I fixed it by implementing the supertabnavigator like this:
<------>
<?xml version="1.0" encoding="utf-8"?>
<SuperTabNavigator xmlns="flexlib.containers.*" 
    xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
            public override function loadState(state:Object):void{
                if(state == null || this.numChildren == 1){
                    this.selectedIndex = 0;
                    return;
                }
                for(var i:int = 0; i < this.numChildren; i++){
                    if(this.getChildAt(i).name == state.selectedName){
                        this.selectedIndex = i;
                        return;
                    }
                }
            }
            public override function saveState():Object{
                var state:Object = {};
                state.selectedName = this.selectedChild.name;
                return state;
            }
        ]]>
    </mx:Script>

</SuperTabNavigator>
<------>
The tabs are just added like normal.

I think that this code should be included as the default in the 
supertabnavigator in
the next release.  

Original comment by jonno...@gmail.com on 12 Mar 2008 at 5:32

GoogleCodeExporter commented 8 years ago

Original comment by dmcc...@gmail.com on 8 Jan 2009 at 4:52