• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ButtonGroup and RadioButton custom binding

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok! Will have a look.
Many thanks.
Carlos.
reply
    Bookmark Topic Watch Topic
  • New Topic