BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-22-2008, 12:35 PM   #1
dynot
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: montreal
Model: 8100
PIN: N/A
Carrier: rogers
Posts: 70
Default How can I change a labelfield text?

Please Login to Remove!

I have a screen with 2 horizontalfieldmanagers and 2 verticalfieldmanagers representing a 4-cell grid. Each cell contains a labelfield with a default value. The code is as follows:

vfmC1.add(new LabelField("r1c1"));

Now I want to set up a listener so that when I enter a value in another part of the screen this LabelField text (r1c1) changes to a new value. I do not want to display another screen or use a dialogbox and would rather just change the value.

How would I go about doing this? I tried this but it doesn't work:

vfmC1.setText("test");

Thanks...
Offline  
Old 08-22-2008, 02:35 PM   #2
RemyJ
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Default

You have to run setText() on the label field itself, not the manager...

LabelField lf = new LabelField("r1c1");
vfmC1.add(lf);
lf.setText("test");
Offline  
Old 08-22-2008, 03:02 PM   #3
dynot
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: montreal
Model: 8100
PIN: N/A
Carrier: rogers
Posts: 70
Default

Thanks Remy.

I actually tried that but didn't work. I tried it again and its fine now. Probably a noobie mistake the first time around.

Thanks again...
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


Chroma 6312 DC Electronic Load Mainframe  picture

Chroma 6312 DC Electronic Load Mainframe

$239.96



Fluke Networks Versiv Modular Mainframe AS IS picture

Fluke Networks Versiv Modular Mainframe AS IS

$1500.00



Agilent HP Keysight 16902B Modular Logic Analysis System Mainframe picture

Agilent HP Keysight 16902B Modular Logic Analysis System Mainframe

$1469.24



SHC SYSTEM 6 MAINFRAME + Mixed Modules 6-562,6-201,6-402. picture

SHC SYSTEM 6 MAINFRAME + Mixed Modules 6-562,6-201,6-402.

$99.99



USED 100%Tested NI PXI-1033 Mainframe Offers pxi 1033  picture

USED 100%Tested NI PXI-1033 Mainframe Offers pxi 1033

$780.90



National Instruments NI PXI-1044 Chassis 14-Slot PXI Mainframe 189105E-01 Rev 01 picture

National Instruments NI PXI-1044 Chassis 14-Slot PXI Mainframe 189105E-01 Rev 01

$199.99







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