BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 08-05-2008, 10:24 PM   #1 (permalink)
New Member
 
Join Date: Aug 2008
Model: 7100T
PIN: N/A
Carrier: Don't know
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to make scroll in the long list ObjectChoiceField

Please Login to Remove!

Hi everyone, Could anyone help me out?
My problem is I have a list of ObjectChoiceField having 10 items. It occupies my whole BlackBerry screen. Now I would like to shorten the list having for example 4 items and using scroll to move down to 10th item. Thanks in advance.
Offline  
Old 08-06-2008, 02:21 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

first you should limit your field to four items. then you overwrite the scrolling behaviour and exchange the items. or you build yourself something to turn the pages like 1-2 small buttons, would make it easier.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 08-06-2008, 02:37 AM   #3 (permalink)
New Member
 
Join Date: Aug 2008
Model: 7100T
PIN: N/A
Carrier: Don't know
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I will try to do what u suggested me.
Offline  
Old 08-18-2008, 04:10 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try with HorizontalFieldManager.

Cheers,
ARIF
Offline  
Old 08-19-2008, 02:45 AM   #5 (permalink)
New Member
 
Join Date: Aug 2008
Model: 7100T
PIN: N/A
Carrier: Don't know
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried to use HorizontalFieldManager but I cant solve the problem. Here is my code. Can u and simon.hain help me out?

public class LimittedObjectChoiceField extends MainScreen{
public LimittedObjectChoiceField(){
String option[] = {"Opt 1", "Opt 2", "Opt 3", "Opt 4", "Opt 5", "Opt 6", "Opt 7", "Opt 8", "Opt 9", "Opt 10"};
ObjectChoiceField choice = new ObjectChoiceField("Object Choice Field: ", option, 0);
HorizontalFieldManager mgr = new MyHorizontalFieldManager();

mgr.add(choice);

add(mgr);
}
}

class MyHorizontalFieldManager extends HorizontalFieldManager{

public MyHorizontalFieldManager()
{
super();
}
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(width, maxHeight);
setExtent(width, getExtent().height);
}

public int getPreferredWidth()
{
return width;
}

}
Offline  
Old 08-19-2008, 10:37 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Dec 2005
Model: 8310
Carrier: Rogers
Posts: 138
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should be aware that the ObjectChoiceField component uses an internal class to render the choice popup. The object is private so you cannot manipulate it. If you want to achieve what you are trying to do, you will have to write your own popup class. A good way to start is to inherit from screen and override sublayout. Then you can manipulate the position and size of your popup screen with setPosition and setExtent respectively. You can use a VerticalFieldManager as your delegate to the screen to achieve the scrolling effect you're after. Good luck!
Offline  
Old 08-19-2008, 09:39 PM   #7 (permalink)
New Member
 
Join Date: Aug 2008
Model: 7100T
PIN: N/A
Carrier: Don't know
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for yr kindness. I will do what you mentioned
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

10pcs Aluminum Cooling 9x9x12MM Heat Sink RAM Radiator Heatsink Cooler kG
$4.29
10pcs Aluminum Cooling 9x9x12MM Heat Sink RAM Radiator Heatsink Cooler kG pictureTektronix 1240 Logic Analyzer Fireware 5-2 with 12RS01 8K Ram Pack
$157.99
Tektronix 1240 Logic Analyzer Fireware 5-2 with 12RS01 8K Ram Pack pictureAB Allen Bradley 2711P-RP2 PanelView Plus Logic Module 128MB Ram/Flash
$1200.0
AB Allen Bradley 2711P-RP2 PanelView Plus Logic Module 128MB Ram/Flash  pictureGE General Electric 44A719326-G01 256k Byte D-RAM Board 44A719252-001R05/5
$74.99
GE General Electric 44A719326-G01 256k Byte D-RAM Board 44A719252-001R05/5 pictureLot of 26 Cypress CY7C185-45PC IC Static RAM SRAM 64KBIT 8K X 8 45 nS 28DIP
$14.99
Lot of 26 Cypress CY7C185-45PC IC Static RAM SRAM 64KBIT 8K X 8 45 nS 28DIP picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.