8 Replies Latest reply on Jun 7, 2014 6:13 AM by Yozef0

    Flex 4 ButtonBar disable toggling off a button by the user, but allow it programatically?

    FM_Flame Level 1

      Here's my case:

       

      I have a website with 2 ButtonBars for the main navigation. One is over the logo with 2 buttons Home and Contacts, and one is below logo with all of the rest buttons.

      I would like them to be sort of connected so when user selects 1 button from one of the menus it should deselect the button selected in the other.

      I managed to do this programatically and it all works fine until the user clicks again on the selected button. Since it's a toggle button it deselects it.

       

      I can't set selectionRequired as u can figure I can't have 2 buttons selected, and listening in CHANGING on the ButtonBars (called only by user interaction) with preventDefault on the event when the selected button is going to be deselected, does prevent the selectedIndex from changing but the button state still changes and visually it looks like it's deselected.

       

      So does anyone know how could I keep my button from being deselected in this case ? Any help will be greatly appreciated! Thanks.