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

Posts: 12
Registered: ‎03-10-2010
My Device: 8900
Accepted Solution

Putting two ObjectChoiceField beside each other



I have tried putting two ObjectChoiceField components in a HorizontalFieldManager, but I cannot display both on the same line, it seems that the second one gets pushed out of screen on the right.


I tried with Manager.NO_HORIZONTAL_SCROLL to no avail.


Can someone please help me ;


Many thanks

Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Putting two ObjectChoiceField beside each other

You can restrict the width of one of them. These two talk about this, though for different Field types:






But if you are sure they will fit side by side, you can define the one on the left with the style

Field.FIELD_LEFT, and I think it will try to stay as close to the left as it can.  Give it a try.

Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Putting two ObjectChoiceField beside each other

Use a style for your "combo boxes". For example:


HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.NO_HORIZONTAL_SCROLL);
String [] items1 = new String [] { "One", "Two", "Three" };
String [] items2 = new String [] { "Four", "Five", "Six" };
ObjectChoiceField choice1 = new ObjectChoiceField("Combo 1:", items1, 0, ObjectChoiceField.FIELD_LEFT); //
ObjectChoiceField choice2 = new ObjectChoiceField("Combo 2:", items2, 0, ObjectChoiceField.FIELD_RIGHT); //