Issue Details (XML | Word | Printable)

Key: FLAMINGO-11
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: kirillcool
Reporter: flynnk
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
flamingo

JCommandToggleButton groups not working for single selection

Created: 02/Aug/08 12:57 AM   Updated: 02/Aug/08 06:43 PM   Resolved: 02/Aug/08 06:43 PM
Component/s: common components
Affects Version/s: 3.1
Fix Version/s: milestone 1

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 11
Tags:
Participants: flynnk and kirillcool


 Description  « Hide

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...)



kirillcool added a comment - 02/Aug/08 10:48 AM

Should be fixed in the latest 3.1dev drop.

Thanks
Kirill


flynnk added a comment - 02/Aug/08 06:43 PM

Confirm fix in latest dev drop.