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

Tags: BlackBerry Developers

Similar Questions

  • 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);
    
  • Align the two signals and measure the Phase Shift

    Hello

    I do an experiment in which I use the NI USB-6221 DAQ card. The jury is able to make 250 k samples/second. I want to measure two voltages in a circuit and find the phase shift between them at frequencies between 1 and 10000. First I ouputted a wave sinusoidal frequency variable through the Commission and applied to a test circuit. Then I used the Board to measure the two tensions consecutively (thus reducing the maximum sampling frequency at 125 k). I used the signals align VI and measured the two phases and then calculates the phase shift (VI attached in Phase 1). It worked well for the test circuit I built in which the phase shift went way logarithmique.20 degrees ~84.5 degrees and then stabilized. At frequencies above 5 000 Hz phase shift must have remained constant, but it varies more or less 1 degree. When the phase shift is 84.5 degrees, present a degree of variability is not particularly explicit. When I asked my program on the circuit that I really wanted to measure, the phase shift went from-. 5 degrees up to about 1.2 degrees. The change in the values of phase shift at high frequencies (> 3000) was environ.2 degrees. Given the small phase shift, this variation is unacceptable. Now I tried to use a sequence to each blood individually (increase the maximum sampling frequency to 250 k) and then align the two signals and measure the phase of each shift. When I use align it and re - sample Express VI to realign the two signals, I get the message "error 20333 analysis: cannot align two waveforms with dt even if their samples are not clocked in phase." Is it possible to align two signals I describe here? I enclose the new VI as Phase 2

    Matthew,

    I think I have an idea for at least part of the problem.

    I took your program data and deleted stuff DAQ.  I have converted the Signal on the chart control and looked then what was going on with the signal analysis.

    The output of the Waveforms.vi line has two waveforms, like the entry.  However, arrays of Y in the two waveforms are empty!  It does not generate an error. After some head scratching, reading the help files and try things out, that's what I think is happening: the time t0 two input signals are 1,031 seconds apart. Since the wavefoms contains 1,000 seconds of data, there is no overlap and may not align them.

    I changed the t0 on two waveforms are the same, and it lines up.  The number of items in the tables is reduced by one. Then I increased the t0 of 0.1 seconds on the first element. The output had both greater than the entry by dt t0 t0 and the size of the arrays was 224998.  Reversing the t0 two elements shifts the phase in the opposite direction.

    What that tells me, is that you can not reliably align two waveforms which do not overlap.

    I suggest that you go to 2-channel data acquisition and that it accept the reduced sample rate.  You won't get the resolution you want, but you should be able to tell if something important happens.

    You may be able to improve the equivalent resolution by taking multiple steps with a slight phase shift. This is similar to the way that old oscilloscopes of sampling (analog) worked. Take a series of measures with the signal you are currently using.  The make enough average to minimize changes due to noise. Then pass the phase of the signal of excitement to an amount that is smaller than the resolution of phase of sampling rate and repeat the measurements.  Recall that I calculated that for a 5 kHz signal sampled at 125kHz, you get a sample every 14.4 degrees. If shift you the phase of 1 degree (to the point/mathematical simulation), you get a different set of samples for excitement.  They are always separated by 14.4 degrees.  Take another series of measures. Transfer phase another degree and repeat.  As long as your sampling clocks are stable enough so that frequency does not drift significantly (and it shouldn't with your equipment), you should be able to get near resolution of what you need.  The trade-off is that you need to perform more measurements and may need to keep track of the phase shifts between the various measures.

    Lynn

  • Need help aligning the SSD to install Windows XP Pro (32 bit)

    OK, I scoured the internet for help on this one - I'm a newbie to SSD - so having to manually align the partitions and find FITTINGS utilities to take care of the "Crusher" is all new to me - so the answers I found on the net were to "over my head" for my last neuron remaining cope!

    The machine is an Asus Eee PC 901/XP - that belongs to a friend of mine. These netbooks have 1 x 4 GB SSD and 1 x 8 GB SSD - I installed XP Pro SP3 on the 8 GB and got to boot from it - only problem is not only slow, but essentially unusable in this same open my computer with no other progs running takes a good 30-45 seconds - and actually run the progs just cripple it.

    After checking the CPU in Tsk Mgr was sod all, that there is plenty of available RAM (I upgraded to 2 GB = max mobo aura), I can only imagine that - now that I've done some reading on these SSDS - the (main?) cause of the non-existent performance is the fact that I have (in my ignorance) doesn't have to align the partitions before installing the operating system.

    I got a 8 GB disk image - using a prog called 'Snapshot' - as I read it, I should be able to then use this image to replace the disk of 8 once I have the aligned partition (this image is now on the 4 GB drive), without messing up alignment - so no doubt I need to align the 4 GB drive as well.

    So, after all that waffle that I would be really happy is a walk of models by using Diskpar (if someone can point me to a working bind it to d/l 1!) -or Diskpart, which I think I can run from my recovery disc of Win7 (from my Dell laptop) - I know that I've seen people talk about running it from a Vista recovery disk, so guess it of the same tool and can help me to do the same job.

    I think I need to remove the volume (?) on the 8 GB, before I can do any alignment - then, as it is currently the only player with a job o/s on this subject, is it possible by booting from the recovery disc too?

    Just for the record the Tech Support Asus was desperate - also, their support for the "Eee" family forum have been down for weeks - then were not able to ask people who have probably all done on this machine!

    Thank you

    Jon

    Hello

    Unfortunately, this is not supported in computer ASUS; You should continue to contact ASUS for support.

    http://support.ASUS.com/ServiceHome.aspx?SLanguage=en

  • I used up to the allocation for the region 1 & 2 DVD for help. stuck on region 1 now. I need to use the two regions for my DVD. Help, please. Beryl

    I used up to the allocation for the region 1 & 2 DVD for help. Stuck on region 1 now.  I need to use the two regions for my DVD. Help, please. Beryl.

    It isn't a MS solution, there are solutions to third parties not supported by MS

  • How to add the table radio button.

    Hello

    I want to update the record if I want that an option of button raduio shaped tabular .There is no option for tabular.
    How to add the table radio button.


    Thank you

    Published by: 805629 on February 3, 2011 04:56

    Use APEX_ITEM. BOX API in the definition of SQL query for the form of tables

  • Check the conditional Radio button

    Hello

    I am building a form where I have elements that must be calculated and have the sum in a (TOTAL) field in the digital field.

    What I'm looking for, it is as shown below. If the number that appears in the TOTAL field falls between 130 and 140, i want the first radio button to be activated automatically, and so on so forth for 5 boxes.

    radio.jpg

    Can you please let me know how to achieve this?

    Note: I am very new to Livecycle Designer.

    Kind regards

    I created a sample for you... Please see the attachment. The code to fill the option boxes is on the RadioButtonList object.

    Paul

  • can not read the text of the element (radio button)

    I am developing a Flash quiz. Several questions have several items of choice with text under each option (button). The text is visible that I see the movie, but when I publish it, the text disappears. all I see are radio buttons with nothihng under them. I use the standard radio button component. I develop the quiz in Flash CS3. I adapt it one that I developed in Flash 8. Option buttons worked perfectly in the old quiz.

    Ideas anyone?

    The answer is this: I had a few scripts of style on the first image that I had forgotten about, the following:
    _Global.style.SetStyle ("fontSize", 8);
    _Global.style.SetStyle ("fontFamily", "Arial");
    _Global.style.SetStyle ("IncorporerPolices", true);

    When I commented on these stars, the text began to show once again. Donkey, your answer may lie in these global statements of style too - maybe add a bit to define and incorporate the police?

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

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

  • Need help with javascript used to check the data in the mandatory radio button fields

    required_fields

    I get a syntax error (SyntaxError: missing: after the id property 17; at line 18).  I am trying to run a script to verify data in all the fields required radio button before letting the user to submit the form (or save).  Here is the code I use:

    var AllRequiredFieldsSet = true;

    for (var i = 0; I < this.numFields;i++)//loop through all form fields)

    {

    var fldName = this.getNthFieldName;

    var currentFld = this.getField (fldName);

    if(currentFld.type=="radio")

    {

    All the radios that are needed to see if the user filled their

    if(currentFld.Value=="OFF")

    AllRequiredFieldsSet = false; one of the option boxes has not been selected, this form cannot be sent

    }

    }

    If (AllRequiredFieldsSet is false)

    App.Alert ("all the required areas have not been met");

    on the other

    this.submitForm ({cURL"mailto:EMAILADDRESS@gmail.com", cSubmitAs: "PDF"});

    Miss me not all media... Any ideas on what I'm missing?

    Thank you! Judy

    These two lines should fix things:

    var fldName = this.getNthFieldName (i);

    ...

    if(currentFld.type=="RadioButton")

  • 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

  • What to put in the xsd schema for the form of the ADF radio buttons?

    Hello, we create a form generated from the data of a HT ADF auto which is a type defined in a schema .xsd. Which schema component Let's in the .xsd schema correspond to buttons option in the form of the ADF? For example, in our .xsd we just

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < xsd: Schema container = ' http://www.w3.org/2001/XMLSchema "xmlns:wf =" " http://www.example.org "

    " targetNamespace = ' http://www.example.org "elementFormDefault ="qualified"> "

    < xsd: complexType name = "FormDataType" >

    < xsd: SEQUENCE >

    < xsd: element name = "FirstName" type = "xsd: String" / >

    < xsd: element name = "Name" type = "xsd: String" / >

    < xsd: element name = "Department" type = "xsd: String" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: Schema >

    What would be the element / type etc be for radio buttons?

    Hi Tali,

    It depends on what you want to do with radio buttons, but it would be better to be a part of string in most cases.

    This could be better handled on the ADF OTN forum, but I'll take a shot at it.  If you have many items to choose from, you can use the string "Department", you already have in your XSD.  When displayed on the form, include various departments with radio buttons next to each other (for example,"manufacturing", "Marketing", "Sales").

    Because this is the BPM forum, I guess your XSD is used as data for a human task which in turn used to create a form of the ADF.  If this is the case, you can use your "Department" in your XSD string element that has already been placed on your form as a text input field.  The reason is the link that you need to update the element of the human task service is automatically created in this way.  Select this field to text, and then in the properties panel, copy the text that is in the 'value' of the field (you stick it in the Value property of the Radio group you will add in the next step).

    There are two ways to get the radio buttons on the form.  You might drag the "Radio group" widget on the form-> click on radio to 'Create a list (select an item)' button-> click the Add icon to add the choices you want to appear on the form (for example,' manufacturing ', 'Marketing', 'Sale').   Once this was added, paste property value text you copied in the previous step into the field of "Value" property of the new Radio group.

    If you select the radio button of the new group source, it should look like this if you wanted two choices for your radio buttons:

    After this has been added, delete the existing text entry field that was created when the form was generated automatically from the human task.

    Hope this helps,

    Dan

  • Structures of the event, radio buttons and the property disable node

    Hello

    I have a very simple VI intended to simulate what I'm trying to accomplish in my program... in fact, when the 3rd option button is selected, I want the text box is disabled and grayed out.  Instead, the case of the event seems to perform the action on the * next * the iteration of the loop.  Can someone tell what I am doing wrong?

    Thank you!

    The terminal of the radio control is inside the case of the discipline concerned.

    (.. .or you can read the new value from the data event [NewVal] node instead if you need the Terminal also).

    Currently, it is read immediately and the value placed in the tunnel. When the event is triggered, the expired value is read from the tunnel.

    Once you pass the terminal in case of the event, it reads only after that the value has changed, and you get the current value.

    Also:

    • You also need an event for the button stop, otherwise the VI cannot be stopped easily.

    • You have the same property node in any of the structure of the case. Put it down after the structure of the case and one is enough.

    • Things that are different are inside the structure of the case.

    • You can combine the cases that are the same (not the default)

    • You can remove the case of timeout.

  • Need to combine the two VLOOKUP formulas and SO, tried several variations... not getting what I need.

    Hi, thanks for the review, any help is appreciated.

    The problem.

    I am creating a spreadsheet to download information to a database.

    The database is very picky and all the blank cells cannot contain a zero but should be empty because some cells contain the URL of the image.

    A '0' instead of a string with a .jpg extension will throw an error.

    In general, I use an 'IF' statement to achieve this:

    = IF (A1 = "", "", A1)

    It works like a charm. However, I changed the map and now the cells have a 'VLOOPUP' function to draw the other worksheet data.

    If the target cell has no data the host cell will express a '0 '. This will raise errors on the upload.

    I tried to embed the two formulas without success. Is it possible to combine the two forms, or is there another solution to draw the other worksheet data and if the receiving cell has no data to express an empty cell / VIRGIN instead of a '0 '.

    If you need an example let me know.

    I hope it's clear.

    I suspect this is related to MS Office Excel.  If I'm not mistaken, please repost this in the MS Office category for the version that you are using the category at the top of the page tab

Maybe you are looking for

  • Anyone having problems with distnoted?

    A number of our machines have been touched by a runaway distnoted process after the upgrade to El Capitan. We never had a problem with it in Yosemite. Basically, the machine will become insensitive and if you are able to open the Terminal or SSH into

  • Question about iPhone 5 c to iOS 9.2 update

    A friend has an iPhone 5 c running iOS 7.1.2 and the phone has 32 GB of storage space.  She tried to upgrade to iOS 9.2 for several days now without any success.  At first, she thought it was a matter of space and she has managed to release about 7 G

  • Cannot export contacts Notes using automator?

    Hello I use automator to save my contacts into one. VCF. I use the Export vCard command. It works fine, but if I have notes attached to the contacts, they are not exported to the. VCF file. I think that it is a bug, unless someone can tell be what I'

  • OfficeJet 6500 E710n Activation error analysis

    When I try to activate the scan on my computer, it is said that there is an error. I restart the computer, as suggested, but it still does not work. It prints normally, but the scanner does not work all of a sudden. I tried to update the IP address a

  • Printer Photosmart 310 has: no display

    After owning my printer for 3 years, he is suddenly ceased to display the regular menu.  It shows only a blue circle with HP in the center of it.   In addition, it does not turn off.   I even tried the key in a few seconds, but it always turns.  I he