BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-30-2009, 10:35 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8130
PIN: N/A
Carrier: don't know
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default setPositionChild() issue in VerticalFieldManager having scrolling support

Please Login to Remove!

Hi,

I am using a VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR) and in paint(), i have set the position of all children such that some of them are not displayed in the current view and shuffled up for e.g.

/* This is just hard coding for understanding. In my code i have applied some logic*/
paint(Graphics g){
setPositionChild(getField(0), 0, -10);
setPositionChild(getField(1), 0, 10);
setPositionChild(getField(2), 0, 30);
setPositionChild(getField(3), 0, 50);
setPositionChild(getField(4), 0, 70);
setPositionChild(getField(5), 0, 90);
setPositionChild(getField(6), 0, 110);
super.paint(g);
}


Now after shuffling the page, current view is displayed properly but when i scroll up, the upper fields are not displayed and and when i scroll down at the end some blank spaces are left. Even after setting position of children such like above, upper scroll indicator is not displayed.

Any suggestion????

Please do reply. I stuck here.
Offline  
Old 11-30-2009, 12:30 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I think setChildPosition should be called in subLayout, not in paint()
Offline  
Old 11-30-2009, 11:46 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8130
PIN: N/A
Carrier: don't know
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.

But I have tried the same in subLayout(), it also fails. I think i am using VerticalFieldManager having scrollability and assign negative offset for a child is the problem.

Am i right???

Can't we set negative offset to a child?? and if not then what do i set offset for a child if i don't want to display it right now.

Please Help.
Offline  
Old 12-01-2009, 08:21 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

My advice would be to set the focus on the field you want to focus on, and forget about the negative offsets.
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





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