Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 6
Registered: ‎03-20-2009
My Device: Not Specified

How do I include a RadioButtonField and a Button in a HorizontalFieldManager!

 

Okay I have a simple HorizontalFieldManager that is supposed to display a RadioButtonField, and a Button.
I am building with API version 4.5.0
So the documentation for RadioButtonField says the following.
"If full available width is desired, then Field.USE_ALL_WIDTH style must be specified using the appropriate constructor."
Okay I don't want the entire width, so I don't include this.  This works fine on most phones I tested with.  But if I test with the 9670, I don't see anything after the radio button.
The documentation for RadioButtonField API 6.0 says the following.
"If full available width is not desired, then RadioButtonField.NO_USE_ALL_WIDTH style must be specified using the appropriate constructor."
Okay looks like the default has changed.  Problem is I am not building against the 6.0 API, so I can't use NO_USE_ALL_WIDTH.  But I shouldn't have to should I?
Does this mean I have to build a separate version of my app for 6.0 phones?
 
HorizontalFieldManager hfm = new HorizontalFieldManager(FIELD_VCENTER);
RadioButtonGroup rbg = new RadioButtonGroup();
RadioButtonField rbBefore = new RadioButtonField("A", rbg, true, Field.FIELD_LEFT);
ButtonField bf = new ButtonField("B");
RadioButtonField rbAfter = new RadioButtonField("A", rbg, true, Field.FIELD_RIGHT);
add(hfm);
hfm.add(rbBefore);
hfm.add(bf);
hfm.add(rbAfter);
HorizontalFieldManager hfm = new HorizontalFieldManager(FIELD_VCENTER);	RadioButtonGroup rbg = new RadioButtonGroup();	RadioButtonField rbBefore = new RadioButtonField("A", rbg, true, Field.FIELD_LEFT);	ButtonField bf = new ButtonField("B");	RadioButtonField rbAfter = new RadioButtonField("A", rbg, true, Field.FIELD_RIGHT);	add(hfm);	hfm.add(rbBefore);	hfm.add(bf); hfm.add(rbAfter);