Skip navigation
Mike Watson
Currently Being Moderated

How to disable ButtonBarButtons before ButtonBar is displayed?

Jan 9, 2013 10:39 AM

Tags: #buttonbar #buttonbarbutton #spark #disables_button

Hello - first posting here...

 

I'm trying to disable (show, but disallow selection) one or more spark ButtonBarButtons in a spark ButtonBar, BEFORE the ButtonBar is displayed to the customer. The idea here is that certain customers will be allowed access to the component associated with a given ButtonBarButton, and others will not. Information about the customer which makes such a decision possible is available at the time the ButtonBar is being created.

 

The application looks like this (excerpted only the relevant parts, I hope):

 

<s:Panel id="menuPanel"

        backgroundAlpha="0.5"

        backgroundColor="#47177d"

        cornerRadius="5"

        height="100%"

        skinClass="com.fedex.refdata.skins.MainMenuSkin"

        title="{ resourceManager.getString( Constants.RESOURCES , 'Menu' ) }"

        width="100%">

  

   <s:ButtonBar id="btnBar"

            dataProvider="{rdViewStack}"

            fontWeight="bold"

            height="100%"

            horizontalCenter="0"

            verticalCenter="0"

            width="20%">

          <s:layout>

                 <s:TileLayout columnAlign="justifyUsingWidth"

                    columnWidth="250"

                    horizontalGap="-1"

                    requestedColumnCount="1"

                    rowHeight="25"

                    verticalGap="-1" />

            </s:layout>

        </s:ButtonBar>

       

        <mx:ViewStack id="rdViewStack"

            borderStyle="none"

            height="100%"

            width="80%">

 

            <s:NavigatorContent id="first"

                height="100%"

                label="{ resourceManager.getString( Constants.RESOURCES , 'First' ) }"

                width="100%">

                 <component:NavigatorContentComponent1 height="100%" width="100%" />

            </s:NavigatorContent>

 

            <component:NavigatorContentComponent2 id="second"

                height="100%"

                label="{ resourceManager.getString( Constants.RESOURCES , 'Second' ) }"

                width="100%" />

 

            <component:NavigatorContentComponent3 id="third"

                height="100%"

                label="{ resourceManager.getString( Constants.RESOURCES , 'Third' ) }"

                width="100%" />

 

         </mx:ViewStack>

    </s:Panel>

 

I HAVE been able to disable components once they've been clicked, but I wish to disable the ability to even click on a ButtonBarButton associated with the component. I haven't been able to find the ButtonBarButtons that are automatically created by the ButtonBar to disable them.

 

Any help would be greatly appreciated. Thanks.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points