BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 04-04-2007, 08:43 AM   #1 (permalink)
New Member
 
Join Date: Apr 2007
Model: 8700c
Carrier: Verizon
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ObjectChoiceField + FieldChangeListener = Headache!

Please Login to Remove!

I'm trying to setup an ObjectChoiceField with a FieldChangeListener which sounds simple enough but I'm running into some weird problems. As of now there are 4 choices but only 3 are being picked up by the fieldChangeListener when they are selected (the "Default" is being ignored). here's the code:

String [] services = ConferenceSettings.getAvailableServices();
int numServices = services.length;
String [] choices = new String[numServices + 2];
int i;
for(i = 0; i < numServices; i++)
{
choices[i] = services[i];
}
choices[i++] = "Custom";
choices[i] = "Default (" + ConferenceSettings.getDefaultServiceString() + ")";
serviceChoice = new ObjectChoiceField("Service: ", choices);
serviceChoice.setSelectedIndex(confSettings.getSer viceIndex());
settingChangeListener = new SettingChangeListener();
serviceChoice.setChangeListener(settingChangeListe ner);

I've tried hardcoding in the indexes of "custom and "default" but that doesn't work. What's even more weird is I really want to use ConferenceSettings.getCustomServiceIndex() and ConferenceSettings.getDefaultServiceIndex() as the indexes which are services.length and services.length + 1 respectively. When I do this the "custom" choice is the one that doesn't work! I can even switch the values of the variables the functions are returning and "custom" still is the one that doesn't fire a changed event.

Any suggestions would be greatly appreciated, my head kinda hurts!
Offline  
Old 04-04-2007, 09:32 AM   #2 (permalink)
New Member
 
Join Date: Apr 2007
Model: 8700c
Carrier: Verizon
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default solved

I figured it out, it just had to do with how i was using my custom FieldChangeListener for other fields. once i made it specific to JUST the objectChoiceField it worked fine
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

MediaMate Amaray 5.25" Floppy Disk Storage Holder Box Vintage Apple Sticker 80s
$12.0
MediaMate Amaray 5.25Vintage Enterprise Mfg. Apple Parer & Stoner Metal & Wood Printing Blocks Stamps
$29.99
Vintage Enterprise Mfg. Apple Parer & Stoner Metal & Wood Printing Blocks Stamps pictureDonald Duck Vintage Case for iPhone & Samsung Case Cover New Case
$9.99
Donald Duck Vintage Case for iPhone & Samsung Case Cover New Case pictureDonald Duck Vintage Case for iPhone & Samsung Case Cover New Case
$14.99
Donald Duck Vintage Case for iPhone & Samsung Case Cover New Case pictureDonald Duck Vintage Case for iPhone & Samsung Case Cover New Case
$14.99
Donald Duck Vintage Case for iPhone & Samsung Case Cover New Case picture






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