Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ButtonGroup and RadioButton custom binding  RSS feed

 
Carlos Conti
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there again,

I have tried to find a nice way to bind the selection outcome of a set of radiobuttons (single selection) in order to reflect the selection of an item in an enumeration, such as if it was a combobox, but haven't found anything promising in the internet and my knowledge in beanbindings is not that much yet. I can think of two workarounds, one of which would be writting a custom converter (always better than handling the value manually through selection listeners!!!) for the binding. However I find this solution a bit dirty. I am sure someone might have figured out much a neater solution. This shouldn't be so difficult.

Another solution I figure out right now, could be creating a subclass of the binding group and enable a value member which could be bound to the binding.

Any further ideas?

Regards and many thanks in advance for your help.

Carlos.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might find my Select Button Group class useful. It already provides a property change "selectedButton" and if that doesn't suffice you can easily add a "selectedIndex" property change on the same lines.
 
Carlos Conti
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok! Will have a look.
Many thanks.
Carlos.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!