1 Reply Latest reply on Jan 10, 2013 9:38 AM by Mike Watson

    How to disable ButtonBarButtons before ButtonBar is displayed?

    Mike Watson

      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.