BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-19-2009, 12:57 PM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7100T
PIN: N/A
Carrier: Verizon
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation A few questions from someone new...

Please Login to Remove!

So, I usually try my best not to post things in forums without searching my brains out for solutions but here goes. I cannot figure out for the life of me why this exception is being thrown. I have some code here:
Code:
		inputParameters = new ObjectChoiceField("Select Input Parameters", inputParametersChoice);
		inputParameters.setChangeListener(new FieldChangeListener() {
			public void fieldChanged(Field arg0, int arg1) {
				try {
					if(inputParameters.getSelectedIndex() == 0) {
						p1Field.setText("Temperature: ");
						p2Field.setText("Pressure: ");
					}
					else if(inputParameters.getSelectedIndex() == 1) {
						p1Field.setText("Temperature: ");
						p2Field.setText("Density: ");
					}
				}
				catch(IllegalArgumentException e) {
					e.printStackTrace();
				}
			}
		});
Here what i'm trying to do is change the value of the text inside a basiceditfield when the value of the objectchoicefield, but every time it just throws that IllegalArgumentException...

Also on a different note, I was wondering if a table layout manager existed for the blackberry because I can't seem to find one. If not, how might i go about implementing one, I saw the Manager class but it went over my head.

And if you're curious this application is for computing thermodynamic properties of water and steam.

Thanks, Wayne
Offline  
Old 03-19-2009, 08:34 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2008
Location: Sioux Falls, SD
Model: 9530
PIN: N/A
Carrier: Verizon Wireless
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

The JavaDoc for the setText method is pretty telling: "IllegalArgumentException - If the text cannot be entered into an edit field."

That being said, I would check to see if the field is editable. I know you're using a "BasicEditField" but given the problem and the JavaDoc, I think it's worth checking.
__________________
Handspring >> Palm >> BB Pearl >> BB Storm

Tumblog: http://www.geekkink.com
Blog: http://www.zechariahs.org/blog
Offline  
Old 03-20-2009, 03:54 AM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

like zechariahs said your basiceditfield might be too short. And I think you want to change the LABEL not the TEXT of it. I guess since it's for displaying some short numeric values, you've restricted it to a fixed size.

show us the part wher you create p1Field and p2Field
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 03-20-2009, 01:24 PM   #4 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7100T
PIN: N/A
Carrier: Verizon
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ah yes, it was because I needed the setLabel.

Another question that I have is is there anything for laying out tables other than creating a custom net.rim.device.api.ui.Manager?
Offline  
Old 03-20-2009, 05:12 PM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

...no
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 03-23-2009, 02:29 PM   #6 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7100T
PIN: N/A
Carrier: Verizon
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

dang, thanks anyway! I appriciate the help. I'm going to try to see if I can get that added to the blackberry api, it seems like a reasonable request...
Offline  




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