BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-29-2007, 01:59 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question "java.lang.illegalStateException" Layout requested during layout

Please Login to Remove!

Hi All

Please help me in resolving this exception, I got from the latest 8800 device JDE Simulator.

The detail exception message is "Layout requested during layout".

This exception occurs while trying to view a mainscreen custom application and this terminates the execution and if I press the Step Into button several times, It continues to display the screen.

Thanks In Advance
Anand
Offline  
Old 06-29-2007, 08:58 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you paste your code we could take a look
Offline  
Old 07-02-2007, 01:53 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Hi

Hi bemshaswing,



This is the code that creates this exception.

Code:
if (result.trim().length() > 0) {
   if (COMM.isPhoneField(fg) || COMM.isEmailField(fg) || COMM.isURLField(attribute)) {

   ActiveAutoTextEditField tt = new ActiveAutoTextEditField(keylabel, result, lenid1,Field.FOCUSABLE);
   tt.setEditable(false);
   vfmfields.add(tt);

   } else {

   AutoTextEditField ttt = new AutoTextEditField(keylabel,result, lenid1, Field.FOCUSABLE);
   ttt.setEditable(false);
   vfmfields.add(ttt);

   }  
}
If I comment the "if (result.trim().length() > 0)" statement checking the exception is no more there, but this will show on the screen some fields(ActiveAutoTextEditField/ AutoTextEditField) that are not intended to show (since they may not contain any values-- empty fields on screen is inappropriate).

and this exception causes only on device 8800, on other devices it's not creating any exception if you not comment the
"if (result.trim().length() > 0)" statement checking

Please tell me If you have any idea to resolve ?

Thanks
Anand

Last edited by Ananthasivan V K : 07-02-2007 at 02:01 AM. Reason: Code Alignment -- Formatting
Offline  
Old 07-02-2007, 08:10 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is the class of "result"? Is it a UI Object?
Offline  
Old 07-02-2007, 08:29 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, it is of type "String"
Offline  
Old 07-02-2007, 11:02 AM   #6 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Seeing as what you've pasted there actually does no layout itself, I'd guess that you're getting a misleading exception. It is possible that this method would throw a null pointer exception on a null String when applying trim (or length for that matter). It's possible that the calling method may be trying to layout a null object because the exception has gone uncaught. This is only a guess given your context here though.
Offline  
Old 10-05-2007, 07:14 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Problem with ActiveAutoTextEditField in 8800

Hi

I need to use ActiveAutoTextEditField UI component in my program. This when I tested with 8800 device simulator
always creates exception.
This exception occurs only when I try to setText a string that is like [email address].
Can anybody help me to getover this
trouble ?

Hoping the best.
__________________
Regards
Anand.

Last edited by Ananthasivan V K : 10-05-2007 at 08:46 AM. Reason: To Give More Accuracy
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.