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


Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh picture

Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh

$179.95



FARM FRESH BLACKBERRIES CLEARANCE BANNER Advertising Vinyl Flag Sign AAA picture

FARM FRESH BLACKBERRIES CLEARANCE BANNER Advertising Vinyl Flag Sign AAA

$168.54



(2 Pack) Gourmet BLACKBERRY SYRUP 32oz. Coffee Drink & Italian Soda Flavor picture

(2 Pack) Gourmet BLACKBERRY SYRUP 32oz. Coffee Drink & Italian Soda Flavor

$24.50



Vintage Working RIM Blackberry 857, Collector's Item R857D-2-5 - SEE DESCRIPTION picture

Vintage Working RIM Blackberry 857, Collector's Item R857D-2-5 - SEE DESCRIPTION

$54.95



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19



Blackberry Bushes for Sale Aluminum Composite Sign picture

Blackberry Bushes for Sale Aluminum Composite Sign

$36.99







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