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: 384
Registered: ‎08-12-2008
My Device: 8700
Accepted Solution

keep calling sublayout issue...




Recently too much question about Torch 9800 device,


I create a screen with a couple of FieldManager.


let me say:


One is Top, one is Middle. and one is at bottom.

Top and bottom are not scrollable, just middle one is scrollable,


Middle one holds two fields, the top one is FieldManger, the next one is ListField, once user click one Item of ListField, this field will add to the top one.and then refresh ListField to show indicate added one with different color.


the issue is, once the item is added to the top, it will call sublayout to re-layout screen, everything works fine on simulator and device not Torch device. once I loaded to Torch device, it will loop  sublayout, if I scroll the FieldManager to hide it, then loop will stop.


is there any person kind offer me some hint? how to trace that? I have worked whole day, and no clue right now.


Thanks in advance.





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

Re: keep calling sublayout issue...

When you say it will loop, is this a recursive call, where sublayout does some processing which itself calls sublayout and so on.  Or does it just keep getting called?


I suspect it just keeps getting called.  In which case you will have to d through all the processing you do and look for something that might make a Field think it needs to lay itself out again.  it sounds like in the middle of layout you are doing something, like a font of Field change, that causes the processing to schedule another layout. 

Posts: 384
Registered: ‎08-12-2008
My Device: 8700

Re: keep calling sublayout issue...

Thanks Peter,


The strange thing is it works on simulator,


You are right, simualtor is different from device.


I look at my source code again, i have done some when do sublayout on one of fieldmanager.


since every time when a field is added to manager, manager will call sublayout, the strange thing is that after

manager invoke sublayout, it will reset itself verticalscroll go to top,


so i first call getverticalscroll to keep current position after layout, i reset it, why I do something like this.


if i do it outside, it will scroll to top, and then scroll to my position, so it is wired to user.



Is there any idea? this is only happen on OS 6.0?




Posts: 384
Registered: ‎08-12-2008
My Device: 8700

Re: keep calling sublayout issue...

Thanks, Peter,


you save lots of time for me.


I found where cause to a recursive call,


and BTW, thanks for rectify my english. Smiley Happy