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

GGLABS F2R16-PROG PCB - Read/Write GGLABS F2R16 ROM emulator - TL866 Amiga
$9.95
GGLABS F2R16-PROG PCB - Read/Write GGLABS F2R16 ROM emulator - TL866 Amiga pictureMOS MPS 6520 Commodore Amiga Atari PIA 40-Pin PDIP Used
$10.0
MOS MPS 6520 Commodore Amiga Atari PIA 40-Pin PDIP Used  pictureLIA3420, This IC is found on Commodore Amiga board at U800, used
$11.0
LIA3420, This IC is found on Commodore Amiga board at U800, used  pictureNew lot of 2pcs ZIP-20 Sockets - 20-pin Zigzag inline package - Amiga 3000
$1.0
New lot of 2pcs ZIP-20 Sockets - 20-pin Zigzag inline package - Amiga 3000 pictureAMIGA 1000 WITH EXTERNAL FLOPPY DRIVE AND 1.1 DISKS ORIGINAL SYSTEM, WORKING
$550.0
AMIGA 1000 WITH EXTERNAL FLOPPY DRIVE AND 1.1 DISKS ORIGINAL SYSTEM, WORKING picture






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