Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6658441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:54:52+00:00 2026-05-26T01:54:52+00:00

is there a common way to disable a tab of a spark tabbar component

  • 0

is there a common way to disable a tab of a spark tabbar component in flex 4? with the mx tabnavigator component you can just disable the content corresponding to the tab and the tab is also disabled then. but doing this with the spark tab bar component disables just the content not the tab.

here is my simple example:

    <mx:TabNavigator x="122" y="155" width="200" height="200">
    <s:NavigatorContent label="Tab 1" width="100%" height="100%">
        <s:Label text="Label1"/>
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab 2" width="100%" height="100%" enabled="false">
        <s:Label text="Label2"/>
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab 3" width="100%" height="100%">
    </s:NavigatorContent>
</mx:TabNavigator>
<s:TabBar x="368.7" y="100.35" dataProvider="{viewstack1}" />
<mx:ViewStack x="364" y="133" id="viewstack1" width="200" height="200">
    <s:NavigatorContent label="Tab 1" width="100%" height="100%">
        <s:Label text="Label1"/>
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab 2" width="100%" height="100%" enabled="false">
        <s:Label text="Label2"/>
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab 3" width="100%" height="100%">
        <s:Label text="Label3" x="1" y="0"/>
    </s:NavigatorContent>
</mx:ViewStack>

many thx,
florian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:54:52+00:00Added an answer on May 26, 2026 at 1:54 am

    Addendum:
    Literally two minutes after I got back to actually working, I found an “elegant” solution using a skin.

    If you apply a custom skinClass to your tab bar you can bind the tab.enabled property just like you’d expect/want.

    <fx:Script>
        <![CDATA[
    [Bindable] private var tab2IsReady:Boolean = false;
    
    private function checkCriteria():void{
        tab2IsReady = someOtherThing.isFinished;//Boolean
    }
    ]]>
    </fx:Script>
    
    <s:TabBar id="theTabBar"
              dataProvider="{viewStack}"
              skinClass="skins.CustomTabBarSkin"/>
    
    <mx:ViewStack id="viewStack">
        <s:NavigatorContent label="Tab index 0">
            <!-- Your first tab's content -->
        </s:NavigatorContent>
    
        <s:NavigatorContent label="Tab index 1" enabled="{tab2IsReady}">
            <!-- Your second tab's content -->
        </s:NavigatorContent>
    </mx:ViewStack>
    

    When you type “skinClass” use the auto complete to generate (in FlashBuilder ~4.5+???) the custom skin (named whatever you want).
    The code will appear like below (I left out the Script tag).

    <?xml version="1.0" encoding="utf-8"?>
    <!-- skins/CustomTabBarSkin.mxml
    ...
    Adobe's copyright & doc comments
    ...
    -->
    
    <s:Skin 
        xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:fb="http://ns.adobe.com/flashbuilder/2009"     
        alpha.disabled="0.5">
    
        <fx:Metadata>
            <![CDATA[ 
            /** 
             * @copy spark.skins.spark.ApplicationSkin#hostComponent
             */
            [HostComponent("spark.components.TabBar")]
            ]]>
        </fx:Metadata> 
    
        <!-- optional Script tag here -->
    
         <s:states>
            <s:State name="normal" />
            <s:State name="disabled" />
        </s:states>
    
        <!--- @copy spark.components.SkinnableDataContainer#dataGroup -->
        <s:DataGroup id="dataGroup" width="100%" height="100%">
            <s:layout>
                <s:ButtonBarHorizontalLayout gap="-1"/>
            </s:layout>
            <s:itemRenderer>
                <fx:Component>
                    <s:ButtonBarButton skinClass="spark.skins.spark.TabBarButtonSkin" />
                </fx:Component>
            </s:itemRenderer>
        </s:DataGroup>
    
    </s:Skin>
    <!-- End skins/CustomTabBarSkin.mxml -->
    

    Change:

        <fx:Component>
            <s:ButtonBarButton skinClass="spark.skins.spark.TabBarButtonSkin" />
        </fx:Component>
    

    To:

        <fx:Component>
            <s:ButtonBarButton skinClass="spark.skins.spark.TabBarButtonSkin"
                enabled="{data.enabled}" />
        </fx:Component>
    

    Then any <s:NavigatorContent/> in the ViewStack with its enabled property set or bound will do exactly what you expect
    (be enabled when true, & disabled when false).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a common way to implement videos on the web that will also
Is there a common way of counting source lines of code (SLOC) in a
Is there a standard/common way to give compiler-style error messages that point to a
Is there a standard or common way in C++ to handle static strings that
Is there a way to set a common Backgroundcolor for all the tabs in
Is there any way to use common tools (ffmpeg? mplayer/mencoder? mkvmerge? etc ) to
I am wondering if there is some way to call C++ code from Common
Is there a common way to express the usage of arguments in C++? I
Is there any common way to decompose an expression created by [NSPredicate predicateWithFormat] to
Is there a common way of dealing with tags in databases? I'm thinking of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.