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
New Developer
Posts: 3
Registered: ‎12-12-2008
My Device: Not Specified

MainScreen doesn't show standard title when NO_VERTICAL_SCROLL is set

[ Edited ]

Hello,

 

I am using JDE v4.2 and I noticed a strange behavior when setting the title on a MainScreen class. The issue that I am having is when I create a new instance of a MainScreen class using the default constructor and set the title to be a label field, the title shows up fine with the standard blueish/greyish background color. However if I pass in the MainScreen.NO_VERTICAL_SCROLL style when constructing the MainScreen, the title does not have a background and is white. Is this a bug or are there other styles that need to be set to show the standard colored background for the title bar? 

 

Colored background

 

_mainScreen = new MainScreen();
_mainScreen.setTitle(new LabelField(TITLE,LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);

 

 

 

No colored background

 

_mainScreen = new MainScreen(MainScreen.NO_VERTICAL_SCROLL);
_mainScreen.setTitle(new LabelField(TITLE,LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);

 

 

 

Message Edited by po6856 on 12-12-2008 05:25 PM
New Developer
Posts: 3
Registered: ‎12-12-2008
My Device: Not Specified

Re: MainScreen doesn't show standard title when NO_VERTICAL_SCROLL is set

Please help with the above post.

 

Thank you 

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: MainScreen doesn't show standard title when NO_VERTICAL_SCROLL is set

I haven't been able to reproduce this using the BlackBerry Simulator included with the version 4.2.0 BlackBerry JDE.  Are you testing with the same one?  If not, what BlackBerry model and handheld software version are you testing with?  You can find this under Options, About.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 3
Registered: ‎12-12-2008
My Device: Not Specified

Re: MainScreen doesn't show standard title when NO_VERTICAL_SCROLL is set

I am using JDE version 4.2.1.41, BlackBerry Device Simulator 2.6.0.49, Blackberry 8800 (v. 4.2.1.89) simulator,

and Blackberry 8800 v 4.2.1.74  actual device.

 

After doing further research, I was able to pinpoint the problem. Basically, what I have is a custom table field consisting of many vertical and horizontal field managers nested together.  When the application starts up it fills the table with data and the title field is incorrectly displayed. However, if there is no data then the title is correctly displayed.

 

I solved my problem by calling pushScreen(_mainScreen) before loading the data in the constructor. This makes me believe that there is a strange bug when laying out the mainScreen and formatting the title bar. Perhaps the title doesn't get formatted due to specific layout logic. Any ideas why it matters when pushScreen is called? 

 

Thanks for your help!! 

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: MainScreen doesn't show standard title when NO_VERTICAL_SCROLL is set

Can you post a code snippet that reproduces the issue?  Depending on what you are doing, it could be that you need the screen layout to take place before you perform your custom actions.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker