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
chriskeith
Posts: 7
Registered: ‎08-08-2009
My Device: Not Specified

sublayout getting called twice

Folks-

 

Ioverrode sublayout() in my subclass of MainScreen. I have the code to addFields to this screen in sublayout() (instead of the constructor) because I wasgetting incorrect values from getPreferredHeight() in the constructor. I am,however, seeing sublayout() called twice. Here are the stacks:

 

KitchenValetScreen.buildMainScreen()line: 86

KitchenValetScreen.sublayout(int,int) line: 82

KitchenValetScreen(Manager).layout(int,int) line: 2231

KitchenValetScreen(Screen).doLayout()line: 1266

UiEngineImpl.pushScreen(Screen)line: 903

KitchenValetApp(UiApplication).pushScreen(Screen)line: 296

KitchenValetApp.<init>()line: 28

KitchenValetApp.main(String[])line: 31

 

KitchenValetScreen.buildMainScreen()line: 86

KitchenValetScreen.sublayout(int,int) line: 82

KitchenValetScreen(Manager).layout(int,int) line: 2231

KitchenValetScreen(Screen).doLayout()line: 1266

UiEngineImpl.doLayoutAll(Screen,boolean) line: 2700

UiEngineImpl.doLayoutAll(boolean)line: 2689

UiEngineImpl.updateScreenSizeAndLayout(boolean)line: 2655

UiEngineImpl.updateScreenSizeAndLayout(int)line: 556

RotationHandler.updateScreenSizeAndLayout(UiEngineInstance,int) line: 505

KitchenValetApp(Application).activateInternal()line: 270

KitchenValetApp(Application).enterEventDispatcher()line: 1070

KitchenValetApp.main(String[])line: 32

 

Thereis no visible result of this on the emulator screen, but I assume I'm creatingall the fields twice.

 

Is thisexpected behavior? If not, any idea what I can do to fix this? I am using theStorm (9500) emulator with the BlackBerry JDEComponent Package version 4.7.0. I can try to create a mini-appto reproduce this if necessary.

 

Thanks In Advance for any help.

Chris Keith

 

Please use plain text.
New Developer
chriskeith
Posts: 7
Registered: ‎08-08-2009
My Device: Not Specified

Re: sublayout getting called twice

 


I have the code to addFields to this screen in sublayout() (instead of the constructor) because I wasgetting incorrect values from getPreferredHeight() in the constructor. 

 


 

 

 

After reading examples, I realized that I should create fields in constructor but lay them out in sublayout. 

Please use plain text.
Developer
macdan
Posts: 157
Registered: ‎05-10-2009
My Device: Not Specified

Re: sublayout getting called twice

If you are adding the fields in sublayout, it will probably cause a recursive sublayout event. 
Please use plain text.