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
Developer
Posts: 77
Registered: ‎04-01-2011
My Device: Bold 9700
My Carrier: Rogers
Accepted Solution

LabelFields/Managers not refreshing properly on scroll

 

I've got a MainScreen, on which I have added several VerticalFieldManagers. Those VFMs contain some LabelFields, as well as other VFMs. This last set of VFM's also contain LabelFields.

 

I have a problem when the lowest level VFM isn't totally in focus (I don't know how else to describe it).

 

Refer to the images I added. The first image shows the screen as it first appears when rendered. The area half displayed at the bottom (with the border) is my lowest level VFM.

 

Now when I scroll down (second image), the missing labels appear (  ie " Low wind < 10 km/h ): "  ) . Notice that the other labels (2.3 km) appear fine (though this isn't always the case, but will suffice for this example I think).

 

The VFMs are simple (adding LabelFields and using sublayout() to arrange them). Can someone tell me what I need to do to fix this?

 

9700a.jpg9700b.jpg

 

Developer
Posts: 228
Registered: ‎10-01-2011
My Device: Passport

Re: LabelFields/Managers not refreshing properly on scroll

Did you try to invalidate the screen to force it to redraw everything?

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

Re: LabelFields/Managers not refreshing properly on scroll

Invalidate would be a good thing to try, but it should not be needed. 

 

Sorry the only suggestion I have is that you try the same thing with everything 'standard', ad then add back in the various complications you have (for example, the sublayouts) until it breaks.  

 

Can you post a simple example that we can play with that demonstrates the problem?

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: LabelFields/Managers not refreshing properly on scroll

If you extend VerticalFieldManager and rearrange some fields manually inside its sublayout, you might get this exact behavior due to its paint optimization (I suppose). If your Manager needs anything fancier than a simple vertical or horizontal arrangement of the fields, either add other managers inside (such as a HorizontalFieldManager to which you then add your LabelFields) or extend Manager and fully implement your own sublayout.

 

Built-in Managers have all kinds of internal tricks which are also bound to change between OS versions. You don't want to override their sublayout much if at all.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Developer
Posts: 77
Registered: ‎04-01-2011
My Device: Bold 9700
My Carrier: Rogers

Re: LabelFields/Managers not refreshing properly on scroll

@crispyoz - I have tried using invalidate() with no success, however I'm never really certain where/when to use it anyway.

 

@peter_strange - I did some minimalizing before I posted, and when I added the 3rd row of labels is when the behaviour started. Unfortunately I can't be sure if it's the number of Fields that is causing a problem or the real estate that they are using (making the containing manager behave differently if it scrolled partially off the screen).

 

@arkadyz - I have overridden a lot of sublayout()'s - your comment worries me! :-) I have done that in this case as well, I will try to redesign the screen with some simpler managers and see what happens.

 

Thanks to all of you for your suggestions.

 

Highlighted
Developer
Posts: 77
Registered: ‎04-01-2011
My Device: Bold 9700
My Carrier: Rogers

Re: LabelFields/Managers not refreshing properly on scroll

I rebuilt the page with a (complicated) series of embedded managers and the refresh/scroll seems to work correctly now. Thanks to everyone for their suggestions.