flamingo
  1. flamingo
  2. FLAMINGO-11

JCommandToggleButton groups not working for single selection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: milestone 1
    • Component/s: common components
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      11

      Description

      The easiest way to reproduce this bug is to run the Flamingo Ribbon
      demonstration application and select the various items in the quick styles task
      band; more than one can be selected. This behavior is inconsistent with the
      documentation and what one would expect from toggle buttons.

      The CommandButtonGroup class does not call setGroup() on the action model from
      the JCommandToggleButton, so the underlying model never makes the callback to
      the group to cause the group to then deselect the other buttons and enforce the
      single selection.

      From my examination of the code, it looks like to get this functionality and
      continue to use the JToggleButton.ToggleButtonModel as the underlying model for
      the JCommandToggleButton, CommandButtonGroup would have to extend ButtonGroup,
      but button group requires the buttons to extend AbstractButton. I think you are
      going to have to reimplement the ToggleButtonModel as well since you no longer
      want the CommandButtons to extend AbstractButton.

      Workaround:

      There is a good workaround to this issue, which lowers the priority a bit. In
      the action listener for the toggle button, you can call the underlying button
      group directly to set the selected button. For example, in a JRibbonBand, you
      can call:

      ribbonBand.setSelectedRibbonGalleryButton("GALLERY_NAME", button);

      Might be a good idea to add this workaround to the example applications until
      the primary issue is fixed (I checked there to see if this was called to see if
      I was screwing up; others might as well...)

        Activity

        Hide
        kirillcool added a comment -

        Should be fixed in the latest 3.1dev drop.

        Thanks
        Kirill

        Show
        kirillcool added a comment - Should be fixed in the latest 3.1dev drop. Thanks Kirill
        Hide
        flynnk added a comment -

        Confirm fix in latest dev drop.

        Show
        flynnk added a comment - Confirm fix in latest dev drop.

          People

          • Assignee:
            kirillcool
            Reporter:
            flynnk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: