1 Reply Latest reply on Jun 11, 2010 8:03 PM by Shongrunden

    Make a s:TabBar to loose focus when another button is clicked

    christomanos

      Hello,

      I have a s:TabBar which I use as menu and a button outside this  TabBar which I use as cart button. When I click my cart button I want to  make all the TabBar's Tabs unselected.

      Thanks in advance

        • 1. Re: Make a s:TabBar to loose focus when another button is clicked
          Shongrunden Adobe Employee

          TabBar requires a selection by default, but you can turn that off and then set the selectedIndex to -1, for example:

           

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark">
             
              <s:controlBarContent>
                  <s:Button label="deselect" click="tb.selectedIndex = -1" />  
              </s:controlBarContent>
             
              <s:TabBar id="tb" requireSelection="false">
                  <s:dataProvider>
                      <s:ArrayList>
                          <fx:String>one</fx:String>
                          <fx:String>two</fx:String>
                          <fx:String>three</fx:String>
                      </s:ArrayList>
                  </s:dataProvider>
              </s:TabBar>
          </s:Application>