BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-28-2009, 04:24 AM   #1
nirmalsat
Knows Where the Search Button Is
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 22
Default How to get ID of controls in manager

Please Login to Remove!

Hi,
I am adding a set controls to a vertical manager iteratively. All the controls are being added to the manager as new instances, as the same set is being added again and again.I need to finally get values from these controls after addition of a certain no of them have been added. I am guessing i would probably need to get some sort of " id " if i need to access them. How should i go about it...
Offline  
Old 08-28-2009, 07:58 AM   #2
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

You can either keep the references to the Fields in variables or collections as they are created, or you can use net.rim.device.api.ui.Manager.getFieldCount() and net.rim.device.api.ui.Manager.getField(int index) to find the fields you want and get the values.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-29-2009, 01:46 AM   #3
nirmalsat
Knows Where the Search Button Is
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 22
Default

I cannot keep reference of the fields when they are being added cos i can only take the values after more than a couple of instances have been added. I have to give the user ability to modify the contents at any point of time and to any instance of the controls.And the problem with using field count is that it only retrieves the values of the last instance. It does not consider the previous instances created. I need all the instances values to be taken at one go ..

Last edited by nirmalsat; 08-29-2009 at 01:48 AM..
Offline  
Old 08-29-2009, 09:07 AM   #4
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

Quote:
Originally Posted by nirmalsat View Post
I cannot keep reference of the fields when they are being added cos i can only take the values after more than a couple of instances have been added. I have to give the user ability to modify the contents at any point of time and to any instance of the controls.And the problem with using field count is that it only retrieves the values of the last instance. It does not consider the previous instances created. I need all the instances values to be taken at one go ..
Code:
for (int i = 0; i < manager.getFieldCount(); i++ ) {
    Field field = manager.getField(i);
    // process the field value
}
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-29-2009, 09:14 AM   #5
nirmalsat
Knows Where the Search Button Is
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 22
Default

Hi,
I am using 4 different managers at the same time. I ve actually solved the problem i was having a new manager within the main manager and adding all instances to the same manager instead of adding it to many different managers.
Anyways thanks for helping me out..
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


3.3ft PT100 RTD Temperature Sensor Probe 3 Wires Cable Thermocouple picture

3.3ft PT100 RTD Temperature Sensor Probe 3 Wires Cable Thermocouple

$18.59



Heavy duty Thermocouple (60 Inch) Blodgett 3835 nickel  plated for pizza ovens picture

Heavy duty Thermocouple (60 Inch) Blodgett 3835 nickel plated for pizza ovens

$14.99



 Digital Thermocouple Thermometer Dual Channel 2*K-Type Temperature Meter picture

Digital Thermocouple Thermometer Dual Channel 2*K-Type Temperature Meter

$23.52



K-Type Thermocouple Probe Digital Thermometer Steel Sensor Spiral Cable  picture

K-Type Thermocouple Probe Digital Thermometer Steel Sensor Spiral Cable

$11.49



Digital Thermometer Dual Channel Input Thermocouple K J T E R N C/F Selection US picture

Digital Thermometer Dual Channel Input Thermocouple K J T E R N C/F Selection US

$25.99



X-TMS152 Thermocouple Probe, TFE RTD Shelded; XTMS152 picture

X-TMS152 Thermocouple Probe, TFE RTD Shelded; XTMS152

$174.99







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