BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-28-2009, 04:24 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
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 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
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 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
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


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





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