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
New Developer
Posts: 22
Registered: ‎05-06-2009
My Device: Not Specified

How do i change the height of ObjectChoiceField?

Hi All,

 

I am developing an application for storm which has  ObjectChoiceField on one of the screens but the native ObjectChoiceField seems to be too big in height that the text in it. i.e. it has some empty space in it above and below the text.Can any one plz tell i do i remove this empty space above and below the text or i do i reduce the height of the ObjectChoiceField. I tried to reduce by overiding the layout and also overiding the getPreferredHeight but none seems to work. Can any one help me with this?

 

 

Thanks,

Sagar 

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

Re: How do I change the height of ObjectChoiceField?

If you are using JDE 4.7, then you are developing for the Storm, which is a touch screen device.  It deliberately enlarges any Fields that it knows you are going to have to hit with your fingers - like Buttons and ChoiceFields.  I would not want to reduce the size of the Field on the Storm.

 

Try using another JDE or OS Level, say 4.6 for the Bold, and see if the 'problem' is still there.

Highlighted
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: How do i change the height of ObjectChoiceField?

Hi,

 

If i understood your problem what you want is to reduce the space in each row, just above and below the text.

 

You can do this using this

 

<list>.setRowHeight(ROW_HEIGHT_FONT);

 

Please let me know if this solved your problem or not.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How do i change the height of ObjectChoiceField?

[ Edited ]

@Rajat_10Sep - I think you are confusing a ChoiceField and a ListField, setRowHeight() is for ListFields.

 

Having said that, a similar thing does apply for ListFields.  If you don't set a RowHeight, the 4.7 OS on a Storm will give you a larger row height with spacing than you will see on an earlier OS.

Message Edited by peter_strange on 05-09-2009 12:57 PM
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: How do i change the height of ObjectChoiceField?

Hi,

 

Sorry my mistake.

 

I read it ObjectListField instead of ObjectChoiceField.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
New Developer
Posts: 22
Registered: ‎05-06-2009
My Device: Not Specified

Re: How do i change the height of ObjectChoiceField?

hi,

 

Thx for ur replies. I tried with jde 4.6 there the height of the object choice field is fine. But i am developing for storm and am handling many touch events and this wont compile in jde 4.6 rt? as TouchEvent comes with o.s. 4.7 .So can anyone please tell me how do i reduce the height of objectchoiceField in storm?

 

Thanks.

Sagar

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

Re: How do I change the height of ObjectChoiceField?

Correct regarding touch Events - if you want to use them, it OS 4.7 and above.

 

However, before we start investigating ways of reducing the height, are you absolutely, 100% sure you want to do this.  Have you actually tried it on a real device?  I suspect that Rim made the Field the size they did for a reason, and if you have any other focusable fields near this one, then users may get frustrated trying to select the ChoiceField if it is too small.

 

Note that Rim also increases the size of Buttons and Checkboxs to make them fat finger friendly (as well as ListFields as already noted.

New Developer
Posts: 22
Registered: ‎05-06-2009
My Device: Not Specified

Re: How do i change the height of ObjectChoiceField?

Hi,

 

Actually the problem here is that the ObjectChoiceField is looking much bigger than all other components the screen. So it is appearing wierd. So just wanted to reduced its size somehow a bit.

 

Thanks,

Sagar 

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: How do i change the height of ObjectChoiceField?

Altering ChoiceFields can get tricky. If you are so inclined you can try handling the layout/painting yourself... otherwise you won't have much luck messing with the ChoiceFields on a Storm.

 

See this thread:

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=31098&query.id=45...