Announcement Announcement Module
Collapse
No announcement yet.
Radio Buttons Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Radio Buttons

    I have tried to find something about radio buttons, but it seems that currently RCP doesn't provide this.

    Is it true?

    If it is, can anyone give me some guidelines how to write one?

    Thanks in advance!

    Charles

  • #2
    You are right, radio buttons are not supported by the Rich Client at present. Central point for components are the ComponentFactory. CheckBox are already supported.

    At present I create JRadioButtons on the usual way, or receive it from my own factory. The radio buttons are then added to the TableFormBuilder.

    greetings

    Comment


    • #3
      And about binding

      Thanks for the quick reply Demo!

      Ok, but how could I put the JRadioButton in the form using the binding?

      You mentioned your own factory. Could you show me some code?

      I'm starting using the framework and I think it is great, but I still don't known the inner details.

      Thanks!

      Charles

      Comment


      • #4
        I've forgotten to say, that I use my JRadioButtons in a view, where the user can select between three options. Here is a snipped:
        Code:
        public class BookingView extends AbstractView{
            private JRadioButton rdbIdSearch = new JRadioButton();
            private JRadioButton rdbMultiSearch = new JRadioButton();
            private JRadioButton rdbDateSearch = new JRadioButton();
           ...
        These buttons are then added to a button group, to ensure that only one button can be active. As I don't use binding for this radio buttons I can use the TableLayoutBuilder:
        Code:
        TableLayoutBuilder b = new TableLayoutBuilder();
        b.cell(rdbIdSearch);
        b.cell(rdbMultiSearch);
        b.cell(rdbDateSearch);
        //some more work
        b.getPanel(); //Returns a JPanel with the buttons
        With component I mean, that I receive a predefined radio button with a configured design, like:
        Code:
        rdbDateSearch = myFactory.createRadioButton();
        Until now I've not used JRadioButtons for binding properties, because I prefer ComboBox instead of radio buttons. If you will offer your user a choice of different values a combo box is a good choice.

        But it will be an interesting feature to create a generic option group for a given collection.

        hope this helps a little bit
        markus

        Comment

        Working...
        X