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: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Drop down list box

In one of these threads I advocated the brute force approach where your component is a class existing outside the normal hierarchy- it is neither a container nor a component nor field. Rather, it has something you call from screen paint to put up whatever you want and whatever API you need to update your model. This avoid having undpredictable results when the PLAF changes and you want a consistent app as well as gives you good flexibility.


I'v played with a few of these and you do have to handle all the details but again as long as you parameterize everything like height and width you should get reasonably consistent results on any platform where the components have a paint method.

Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: Drop down list box

Don't call super.paint(g).

New Developer
Posts: 39
Registered: ‎10-13-2009
My Device: Not Specified

Re: Drop down list box

I fixed this issue. Actually I used a workaround. And that is that instead of using the Label part of OCF use a LablField. I mean when you need to show an OCF with Label say "Mine: " and a set of array list then rather than doing this


myOCF = new ObjectChoiceField("Mine: ", listOfItems, selected, FOCUSABLE | ChoiceField.FIELD_LEFT)



do this



LabelField myField = new LabelField("Mine: ", LabelField.READONLY | LabelField.FIELD_VCENTER | LabelField.NON_FOCUSABLE) {        };


myOCF = new ObjectChoiceField("", listOfItems, selected, FOCUSABLE | ChoiceField.FIELD_LEFT)


Now what happens in this case in Storm 2 is that it takes much lesser space and adjusts it better in the screen width. In all other simulators it works just fine.


New Developer
Posts: 9
Registered: ‎07-23-2008
My Device: Not Specified

Re: Drop down list box

Hi All,


       I am developing an application for BB 4.2, can any one please send the drop down list code similar to html drop down box, need urgent response.It should contain a textbox with dropdown icon, on click of this icon it should display the choices.


Thanks in advance,


Posts: 57
Registered: ‎01-29-2009
My Device: Not Specified

Re: Drop down list box

[ Edited ]

One way through you can achive this is override the paint method and draw image to the ObjectChoiceField.

Or make custom ObjectChoiceField.