BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-29-2007, 01:59 AM   #1
Ananthasivan V K
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
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
bemshaswing
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Default

If you paste your code we could take a look
Offline  
Old 07-02-2007, 01:53 AM   #3
Ananthasivan V K
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
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
bemshaswing
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Default

What is the class of "result"? Is it a UI Object?
Offline  
Old 07-02-2007, 08:29 AM   #5
Ananthasivan V K
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Default

No, it is of type "String"
Offline  
Old 07-02-2007, 11:02 AM   #6
bemshaswing
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
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
Ananthasivan V K
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
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  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Schneider 140CPU65150 processor module 140CPU65150 140CPU65150 picture

Schneider 140CPU65150 processor module 140CPU65150 140CPU65150

$2898.00



AB 1747-L542 /C SLC 500 5/04 CPU PROCESSOR UNIT 1747L542 NEW Factory Sealed picture

AB 1747-L542 /C SLC 500 5/04 CPU PROCESSOR UNIT 1747L542 NEW Factory Sealed

$380.00



AlphaSmart Neo2 Laptop Word Processor Portable Notebook Pad picture

AlphaSmart Neo2 Laptop Word Processor Portable Notebook Pad

$89.97



AlphaSmart Neo2 Laptop Word Processor, . picture

AlphaSmart Neo2 Laptop Word Processor, .

$90.00



Brother DP-525CJ Word Processor Desktop Publisher Typewriter User Manual Floppy picture

Brother DP-525CJ Word Processor Desktop Publisher Typewriter User Manual Floppy

$355.00



502-04137-00 M1016.9694 R6 CPU943 GIDDINGS LEWIS  picture

502-04137-00 M1016.9694 R6 CPU943 GIDDINGS LEWIS

$317.76







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