two radio buttons on one line

Hello

I can't do radio two buttons appear on the same line.  I see only the first option button...

            RadioButtonGroup group = new RadioButtonGroup();            RadioButtonField radio1 = new RadioButtonField("one", group, true);            RadioButtonField radio2 = new RadioButtonField("two", group, false);            HorizontalFieldManager hfm = new HorizontalFieldManager();            hfm.add(radio1);            hfm.add(radio2);            add(hfm);

I tried different settings of style on the option and Manager of the horizontal boxes.  I also tried extending RadioButtonField to explicitly set the field width.  So far no luck...

I work with version 4.2.1.

Any help would be appreciated.

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Manager;

public class RadioButtonLayout extends Manager{

    public RadioButtonLayout() {
         super(Manager.VERTICAL_SCROLL | Manager.RIGHTMOST);
    }

    protected void sublayout(int width, int height) {
         Field field;
           //get total number of fields within this manager
           int numberOfFields = getFieldCount();
           int x = 0;
           int y = 0;
           for (int i = 0;i < numberOfFields;i++) {
               field = getField(i); //get the field
               setPositionChild(field,x,y); //set the position for the field

               layoutChild(field, width, height); //lay out the field
               x += 30;
           }

           width=70;
           height=20;

           setExtent(width, height);
    }

}

RadioButtonGroup rg = new RadioButtonGroup();

RadioButtonLayout v = new RadioButtonLayout();

v.add(new RadioButtonField("", rg, true, RadioButtonField.FIELD_RIGHT));
        v.add(new RadioButtonField("", rg, true,  RadioButtonField.FIELD_RIGHT));

screen.add(v);

Tags: BlackBerry Developers

Similar Questions

  • Need to align the two radio buttons in one line

    Hi all

    In my BlackBerry Application, I have a part of the user interface where I need to align two radio buttons in one line.

    I used the code to design the user interface, but the two radio buttons below are overlapping.

    SerializableAttribute public class BBSettingsScreen extends form {}

    Rbg RadioButtonGroup = new RadioButtonGroup();

    RadioButtonLayout raButtonLayout = new RadioButtonLayout();

    raButtonLayout.add (new RadioButtonField ("ONE", rbg, true, RadioButtonField.FIELD_RIGHT));
    raButtonLayout.add (new RadioButtonField ("TWO", rbg, false, RadioButtonField.FIELD_LEFT));

    Add (raButtonLayout);

    SerializableAttribute public class RadioButtonLayout extends Manager {}

    public RadioButtonLayout() {}
    Super(Manager.VERTICAL_SCROLL |) Manager.RIGHTMOST);
    }

    protected void sublayout (int width, int height) {}
    Field field;
    get the total number of areas falling under this Manager of
    int numberOfFields = getFieldCount();
    int x = 0;
    int y = 0;
    for (int i = 0; i)< numberoffields;i++)="">
    field = getField (i); get the field
    setPositionChild(field,x,y); set the position of the field

    layoutChild (field, width, height); Spread the field
    x += 30;
    }

    width = 70;
    height = 20;

    setExtent (width, height);
    }

    }

    }

    Please help on this...

    Thank you & best regards

    Chintada Ravikumar

    Try this:

    RadioButtonGroup rgb=new RadioButtonGroup();
    HorizontalFieldManager hr1=new HorizontalFieldManager(FIELD_HCENTER);
    RadioButtonField radioOne=new RadioButtonField(" RadioOne",rgb,true)
    {
        protected void layout(int width, int height)
        {
            super.layout(75,30);//Width and height according to the button name;
            setExtent(75,30);//width and height according to the button name;
        }
    };
    hr1.add(radioOne);
    RadioButtonField radioTwo=new RadioButtonField(" RadioTwo",rgb,false)
    {
        protected void layout(int width, int height)
        {
            super.layout(75,30);//Width and height according to the button name;
            setExtent(75,30);//Width and height according to the button name;
        }
    };
    radioTwo.setPadding(0, 0, 0, 20);
    hr1.add(other);
    add(hr1);
    
  • How can I get my buttons on one line?

    I tried to put two radio buttons in the cell of a text in a table, but I can´t get next. They put on top of each other, in a vertical list, no matter what I do.

    Sorry for the stupid qustion, but this is my first attempt in LiveCycle Designer.

    Thanks for your time. I found the soloution. I changed the flow direction in the suborm of 'top-down 'Western text.

  • two radio buttons on the same line

    Hello

    I wanted to add two option buttons, which should appears on the same line, which is provided for in the other. How can ido that?

    I try like this:

    VerticalFieldManager vfmMain;
    HorizontalFieldManager hfmRadio;

    Household RadioButtonField, rSetup;

    Household = new RadioButtonField ("View");
    rSetup = new RadioButtonField ("Setup");

    hfmRadio = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER);

    hfmRadio.add (household);
    hfmRadio.add (rSetup);

    vfmMain = new VerticalFieldManager(VerticalFieldManager.HORIZONTAL_SCROLLBAR |)
    VerticalFieldManager.VERTICAL_SCROLLBAR);

    vfmMain.add (hfmRadio);

    but his he sent me some exception.

    any idea?

    Thanks in advance.

    Hey guys find a solution very simple for this

    VerticalFieldManager vfmMain;

    HorizontalFieldManager hfmTemp;

    vfmMain = new VerticalFieldManager();

    hfmRadio = new HorizontalFieldManager();

    RadioButtonGroup grp;

    View RadioButtonField, Setup;

    GRP = new RadioButtonGroup();

    view = new RadioButtonField ('View', grp, true, RadioButtonField.FIELD_LEFT);

    Setup = new RadioButtonField ("setup", grp, false, RadioButtonField.FIELD_RIGHT);

    hfmRadio.add (view);

    hfmRadio.add (setup);

    vfmMain.add (hfmRadio);

    try this if someone is loking for the option button

  • Fill in the text field when TWO radio button is unchecked

    Hello

    I don't know anything about javascript and need help.  I have a photography contract I want to offer a "discount package" of $50 when the two services will be used.  1 service is 'Photography coverage' and Service 2 'Photo Booth Rental'.

    Text field 1 = subtotal (calculates the values of checkbox and radio button)

    Text field 2 = discount (it's where I need help.  I would like this automatically filled with $50 when my default two boxes are not selected.  But only when the TWO are not selected)

    Text field 3 = Total (which has a basic calculation of the Subtotal-Discount)

    The services of two by default (it's done on purpose, I checked from the beginning) are both set to the '0' values to keep the subtotal $ 0.  If the client will use a service (which means one of the default selections will be selected), then there will be no discount, but if they decide to use photography and the cabin, they save $50.

    Can someone please help me to write a script for the text field, Discount calculation, to accomplish what I ask?

    Untitled-3.jpg

    You can use something like what the calculation script custom field discount:

    Event.Value = (this.getField("Service1").value == 0 | this.getField("Service2").value == 0)? 0: 50;

    Simply adjust the field names in the code to match the real in your file.

  • fields to show or hide the function of radio button

    Hi, in my form there are two radio buttons available. one is for 'Yes' and other is for the 'no '. There is also another 6 available and that all fields 6 fields are hidden by default.  If I click on 'Yes' below 3 fields should visible.

    text-1

    text-2

    text-3

    If I click on "no" above 3 fields must hide & 3 fields should visible below.

    text-4

    text-5

    text-6

    then u can pls give me JavaScript to manage my requirement. Thanks in advance.

    Hiding and showing form fields by Thom Parker

    Disabling (graying-out) form fields by Thom Parker

  • How to customize the height between the two options of the Radio button control component?

    Hi all

    Please help me.

    I want to reduce the height of two radio button options. I change the Radio band height & width but between two option has not changed.

    I try this code below in qml

    RadioGroup {}
    ID: radiogroup
    layoutProperties: {AbsoluteLayoutProperties}
    positionY: 375.0
    positionX: 600,0
    }
    preferredWidth: 100.0
    preferredHeight: 440,0
    maxHeight: 440,0
    minHeight: 440,0
    Option {id: stc; text: ' '; selected: true}
    Option {id: mobily; text: ""}
    Option {id: zain; text: ""}
    Option {id: blackberry; text: ""}
    }

    Please help me

    I solved this problem using scale Propertie of the RadioGroup.

    Thanks for your comments.

  • Print multiple lines of page based on radio button choice group

    Hello... I have a PDF file that is a form of group request, consisting of 6 distinct forms. On the first page, I have 6 groups of option buttons "Yes / No".

    If the radio button for one or more of these groups is selected as 'Yes', then when button click Print (on the page) then the appropriate page range prints.

    It is desirable but not essential for them to be printed in a print job.

    The Code I've been adjust to try to get the result is less but I have myself linked in knots now and any help would be greatly appreciated:

    Thank you very much

    
    
    //<AcroForm>
    //<ACRO_source>PrntForms:Annot1:MouseUp:Action1</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: AcroForm:PrntForms:Annot1:MouseUp:Action1 ***********/
    var nButton = app.alert({
    cMsg: "Your selected forms will be sent to your default printer.\n\nIf you require to print to an alternative printer, press cancel and select 'Print' from the 'File' menu.",
    cTitle: "Submit Forms for Printing?",
    nIcon: 1, nType: 1
    });
    // array for button responses
    //var aResponse = new Array("OK", "Cancel");
    
    if(nButton == 1) 
    {    this.print({ bUI: false, bSilent: true, bShrinkToFit: true, nStart: 1, nEnd: 1 });
    } else
    if(nButton == 0) 
    {    this.Exit
    }
    
    var a_app;
    if(this.getField("AppForm1”).value=="Yes"){
        a_app = "1, 1";
    } else a_app = "0, 0"
    
    var b_app;
    if(this.getField(“AppForm2”).value=="Yes"){
        b_app = "2, 2";
    } else b_app = "0, 0"
    
        var pp = this.getPrintParams();
              pp.interactive = pp.constants.interactionLevel.full;
              pp.printRange=[[a_app], [b_app]];
              this.print(pp);
    //</ACRO_script>
    //</AcroForm>
    
    

    In fact, the last part should be something like this (I tried to change the code, but it is buggy):

    If {(printRanges.length>0)}

    pp var = this.getPrintParams ();

    pp.interactive = pp.constants.interactionLevel.full;

    pp.printRange = printRanges;

    This.Print (pp);

    } else app.alert ("no page ranges are selected.");

  • Database radio button

    I have two radio buttons in a table with a subform cell positioned. The data of this exclusion group will not export to a spreadsheet. No idea why? the binding table, line, group and look good. Why?.Capture.PNG

    Hello

    I think it's one of the things that broke in Acrobat X, used to work in 9 and seems to XI.

    If you're on Acrobat X, maybe you can add a hidden textfield and set its value to the change event of the radio button.

    Then;

    HiddenAuditResult.rawValue = AuditResult.rawValue;

  • Radio buttons determine what company logo appears

    In the ss9, I created a form using the generator feature of the Action where the first line is two radio buttons for the user to choose which of our two companies they work for. According to their choice, corresponding company logo went from invisible to visible on the Master Page. It works fine, but when a second page is generated dynamically, the logo appears on page one. How to display on all subsequent pages generated?

    Hi Don,

    Error in basic on my part I like to use the docReady event because it fires only once, as the form is returned on departure. However, that's the problem here. When a new page is rendered, the docReady event does not fire, so the new instance of the ImageField is open.

    Simple solution is to move the docReady event script to the initialize event of the ImageField. I modified the sample, same link (http://assure.ly/sUcrHx).

    Niall

  • still trying to make more visible radio button selections

    11.1.1.4 forms (us better not know because it is not certified for 2012r2 which is the machine that we could put this on.)  We expect...)

    in when-radio-changed before

    OK after having corrected a mistake big it's the current code:

    It works to set a different color when running a label radio! But there is a problem. I can't seem to

    unplugged the color. When the user selects another radio button colors should change course.

    For some reason any, as I get to the effect that they cannot be changed again. Any ideas?

    Does anyone know how to specify < unspecified > as a color? I tried many things and no

    work.

    declare

    currfield varchar2 (64): =: system.trigger_field;

    Val varchar2 (10): = 0;

    unpickedcolor varchar2 (20): = "r50g75b50";

    pickedcolor varchar2 (20): = "r100g100b100";

    Start

    set_radio_button_property (currfield, 'CONCENTRATE0', BACKGROUND_COLOR, unpickedcolor);

    set_radio_button_property (currfield, 'CONCENTRATE1', BACKGROUND_COLOR, unpickedcolor);

    set_radio_button_property (currfield, 'CONCENTRATE2', BACKGROUND_COLOR, unpickedcolor);

    set_radio_button_property (currfield, 'CONCENTRATE3', BACKGROUND_COLOR, unpickedcolor);

    Val: = trim (name_in (currfield));

    If val = '0' then

    set_radio_button_property (currfield, 'CONCENTRATE0', BACKGROUND_COLOR, pickedcolor);

    elsif val = "1" then

    set_radio_button_property (currfield, 'CONCENTRATE1', BACKGROUND_COLOR, pickedcolor);

    elsif val = "2" then

    set_radio_button_property (currfield, 'CONCENTRATE2', BACKGROUND_COLOR, pickedcolor);

    elsif val = "3" then

    set_radio_button_property (currfield, 'CONCENTRATE3', BACKGROUND_COLOR, pickedcolor);

    end if;

    synchronize;

    end;

    I got it! Many hours trying things, doing really, really, really stupid mistakes, etc. And the answer is below.

    NOTE that it is impossible to change the BACKGROUND_COLOR of the option button, because what happens is the color change _sticks_. (11.1.1.4) if the user has chosen an option button and then selects another so you have two radio buttons that have the selected color and so on. But it happens with VISUAL_ATTRIBUTE is the way to go. Here, I got a Visual attribute (which replaces the background_color) and the font size and the font defined for the radio group and that does not cause a problem. All the radio button properties have the default value and .

    It comes to relax when-radio-changed before status.  CURRENT and SELECTED are defined VISUAL_ATTRIBUTES.

    Now, if only there were an easier way of coding this because having a zillion radio groups this is going to be one heck of a

    a lot of work duty code using hard-coded radio_button_names.

    declare

    currfield varchar2 (64): =: system.trigger_field;

    Val varchar2 (10): = 0;

    Start

    Val: = trim (name_in (currfield));

    set_radio_button_property (currfield, 'CONCENTRATE0', VISUAL_ATTRIBUTE, 'CURRENT');

    set_radio_button_property (currfield, 'CONCENTRATE1', VISUAL_ATTRIBUTE, 'CURRENT');

    set_radio_button_property (currfield, 'CONCENTRATE2', VISUAL_ATTRIBUTE, 'CURRENT');

    set_radio_button_property (currfield, 'CONCENTRATE3', VISUAL_ATTRIBUTE, 'CURRENT');

    If val = '0' then

    set_radio_button_property (currfield, 'CONCENTRATE0', VISUAL_ATTRIBUTE, 'SELECTED');

    elsif val = "1" then

    set_radio_button_property (currfield, 'CONCENTRATE1', VISUAL_ATTRIBUTE, 'SELECTED');

    elsif val = "2" then

    set_radio_button_property (currfield, 'CONCENTRATE2', VISUAL_ATTRIBUTE, 'SELECTED');

    elsif val = "3" then

    set_radio_button_property (currfield, 'CONCENTRATE3', VISUAL_ATTRIBUTE, 'SELECTED');

    end if;

    synchronize;

    end;

  • Radio button selected user jumps to the text field

    Hello

    Is there a way to blow up a user of a radio button selected in a text field.  For example...

    1. the user will have two options of the radio button.  One option is YES and one option is no.

    2. the user must choose Yes or no (must)

    3. If the user selects YES (radio button), I want the shape of jump them to a text field to fill out additional information.

    I was able to do this with a box, but not the radio button.

    I did research online and via the forums but have not yet found a solution.

    Thanks much for any direction or resources!

    OK, with a checkbox or a radio button, you can use the mouse event to the top, but check the value is different. For the Yes option button where the value of the key (aka export value) is set to 'Yes', you would do something like:

    Script mouse upward to a radio button

    If (event.target.value = 'Yes') {}

    getField("text1").setFocus ();

    }

    Do the same for the box but use the corresponding export value.

  • Using radio buttons

    Good day all.

    This is the first time I tried to use radio buttons on a form, so this issue "could" be very simple to most of you.

    I have a list of questions to add to a form, and the user must answer the questions using radio buttons. There will be 3 buttons for each question. Yes, no and n/a. I use raidio buttons I want only the user to select 1 choices. Thus, the shape will be casting so I thought that I need to put the question and boxes option in a table. When I tried this, the radio buttons 'statcked' one on top of the other. I would need to have the radio 'next' buttons between them. So it would look like.

    Question                                                                                                        0 Yes     0 No     0 N/A

    Any help would be appreciated

    Concerning

    Chomp

    The way you add radio buttons in the form you have downloaded seems to be OK...

    But one thing I've observed is, you put each line in a separate table in the form that you do not need to. You can have a table and have as separate lines. (the modified file attached)

    I would like to know if you still have any questions...

    https://Acrobat.com/#d=YM8D0zmRdG8IdqqgQ3 * z3Q

    Thank you

    Srini

  • Script needed for radio button/date field

    Hello

    I am currently using Adobe Lifecycle Designer ES.  I have a form that contains two radio buttons (each dependant on the other).  One of the option buttons, if it is enabled, has a date field that I have needed to fill if this option button is selected.  I suppose that this could be done with an "if" statement, but I'm not very good at the code and I was wondering if anyone can help?  Thank you.

    Hello

    I have an example here: http://assure.ly/hxHupW.

    You can change the required property using script.

    To make a field required, you set the property to "error". Considering that, to make an optional field, you set the property to "disabled".

    If one considers that the value of the radiobutton that you want to use to define the mandatory datefield is '1', then the code following JavaScript in the click event of the radiobutton exclusion group:

    if (this.rawValue == 1)
    {
         datefield.mandatory = "error";
    }
    else
    
    {
         datefield.mandatory = "disabled";
    }
    

    Hope that helps,

    Niall

  • Pop - up screen with radio buttons

    Hello
    I am a new on APEX and I have a requirement for the creation of the popup page with two radio buttons.
    It must be that this pop pop before the departure/homepage. The user must select at least one of these radio buttons and then it goes back to the start/homepage without condition.


    Thank you
    Manoi.

    Hi Eric,.

    OK - the user ended up with the login page and has not yet loaded page 1. Therefore, there is no page on screen, which is not possible :D

    What you can do, is something like the following:

    1. in your application, thanks to shared components, create an element of Application called, say, G_OK_TO_CONTINUE

    2. on your 1 page, create a new branch. The branch to this Point should be set "on load: before the Header ' (is the point before any rendered page starts). The page points to would be your "popup1" (except that this should probably be a normal page, instead of a popup). The terms section for this branch would have the following parameters:

    Condition Type: Value of element in the Expression 1. Expression 2 =
    Expression 1: G_OK_TO_CONTINUE
    Expression 2: 1

    3. on your "popup1" page, you should then have a branch that directs the user to page 1. This branch must assign G_OK_TO_CONTINUE 1 (use the "these elements the value" / "with these values" settings on the branch to do) otherwise, you create a loop.

    For example, when the user first connects, Apex trying to load page 1. The new branch is checked immediately and, as G_OK_TO_CONTIINUE is NULL at this point (and, therefore, is not equal 1), the branch will be triggered and the user is redirected to your page "popup1". They do what they can do on this page and, if you actually go to page 1, the branch back to page 1 sets G_OK_TO_CONTINUE to 1, the new branch on page 1 verifies this and because the condition is false, the branch is not triggered and the user goes to page 1

    Andy

Maybe you are looking for