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 6703513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:10:48+00:00 2026-05-26T07:10:48+00:00

I’m trying to figure out whether it is possible to define view navigators and

  • 0

I’m trying to figure out whether it is possible to define view navigators and selectively hide some depending on a particular user state?

For example I have two navigator tabs one which is a sign in tab and the other shows a users policy. I only want the policy tab to be visible if the user has signed in:

<s:ViewNavigator id="policyTab" width="100%" height="100%" firstView="views.policy.PoliciesView">
    <s:navigationContent>
        <s:Button id="policyTabButton" label="Policies" click="tabButton_clickHandler(event)" />
    </s:navigationContent>
</s:ViewNavigator>

Sign in tab is navigator:

<s:ViewNavigator id="signInTab" width="100%" height="100%" firstView="views.SignInView">
    <s:navigationContent>
        <s:Button id="signInTabButton" icon="@Embed('images/lockSmall.png')" click="tabButton_clickHandler(event)" />
    </s:navigationContent>
</s:ViewNavigator>  

Everything that I’ve researched points me to hiding the entire tab bar which I don’t want to do. I’ve tried simply calling signInTab.visible = false; but is doesn’t work.

Any help would be appreciated.

  • 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-26T07:10:49+00:00Added an answer on May 26, 2026 at 7:10 am

    It is true that you can’t hide the contents of a TabbedViewNavigator, but there is another way to adjust the content to hide tabs. Basically you can remove the tab from the TabbedViewNavigator to hide it and re-add it to show it again. I’ve come up with a very simple example which seems to do what you are asking.

    TabbedViewNavTest.mxml:

    <?xml version="1.0" encoding="utf-8"?>
    <s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                      xmlns:s="library://ns.adobe.com/flex/spark"
                                      applicationDPI="160"
                                      preinitialize="preinitializeHandler(event)">
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
    
                import views.Tab2View;
    
                private static var app:TabbedViewNavigatorApplication;
    
                public static function adjustTabBar():void {
                    if(app.navigators.length > 1) {
                        removeTab2();
                    } else {
                        addTab2();
                    }
                }
    
                private static function removeTab2():void {
                    app.tabbedNavigator.removeItemAt(1);
                }
    
                private static function addTab2():void {
                    var tab2:ViewNavigator = new ViewNavigator();
                    tab2.label = "Tab2";
                    tab2.percentWidth = 100;
                    tab2.percentHeight = 100;
                    tab2.firstView = Tab2View;
                    app.tabbedNavigator.addItemAt(tab2, 1);
                }
    
                protected function preinitializeHandler(event:FlexEvent):void {
                    app = this;
                }
    
            ]]>
        </fx:Script>
    
        <s:ViewNavigator id="tab1" label="Tab1" width="100%" height="100%" firstView="views.Tab1View"/>
        <s:ViewNavigator id="tab2" label="Tab2" width="100%" height="100%" firstView="views.Tab2View"/>
    
    </s:TabbedViewNavigatorApplication>
    

    Tab1View.mxml:

    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark"
            title="Tab1">
    
        <fx:Script>
            <![CDATA[
                protected function showHideButton_clickHandler(event:MouseEvent):void {
                    TabbedViewNavTest.adjustTabBar();
                }
            ]]>
        </fx:Script>
    
        <s:Button id="showHideButton" label="Click Me!" click="showHideButton_clickHandler(event)" />
    </s:View>
    

    Tab2View is just an empty view that was created when I created the project.

    While this should do what you need it to do, I’m wondering if there is a better way to achieve what you are attempting to do. For instance, in the case you originally presented of a login tab which disappears when the user logs in you could have created your application as a generic application with 2 states: notLoggedIn and loggedIn. In the notLoggedIn state you only have a view show that presents the login screen, or have a tabbedViewNavigator show which has the login and policy tabs. In the logged in state, you have a separate tabbedViewNavigator which has only the policy tab or perhaps the other tabs available when a user is logged in. If you want me to create an example of what I mean, let me know and I can do that.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:

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.