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: 196
Registered: ‎12-14-2009
My Device: Not Specified

How to get a Total Screen Relayout/Reload?

[ Edited ]

On one screen I have options that are stored in memory that label buttons on another screen. After the options have been saved in memory on that options screen I pop the screen to reveal the screen with buttons. How can I get the buttons to reflect the new names without the screen getting all mussed up? I tried onexposed method for the main screen with the buttons and setLabel(), but it reshapes the sizes of the buttons after the labels are set and the screen looks like it has been zoomed in. How can I get it so the screen redoes the whole layout? I've tried invalidate and dopaint to no avail. The buttons are on a grid. They are half the page size. The grid is fixed width. I want to maintain that even grid spacing and size.

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

Re: How to get a Total Screen Relayout/Reload?

updateLayout (of any Field, including your Screen) causes the whole screen to re-layout. Use it instead of invalidate (which only causes the invalidated field to redraw.

However, your problem might lie elsewhere - setLabel on ButtonFields re-layouts anyway. If updateLayout doesn't work, see if you have any custom layout/sublayout methods and whether they are doing the right thing.

please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!