BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 05-06-2009, 05:40 PM   #1 (permalink)
New Member
Join Date: May 2009
Model: 8100
Carrier: Verizon
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ChoiceGroup itemStateChanged fired multiple times bug in BB OS?

Please Login to Remove!


Here is the background for the problem: I have a recursive list of hashtables(hashtable inside another hashtable) and a form with a POPUP ChoiceGroup that is initially filled with the keys from the root hashtable. When the user selects a particluar entry a different ChoiceGroup popsup with the keys of the hashtable pointed to by the earlier selection and this goes on till an empty hashtable is found. I have noticed that when the user selects and entry in the root hashtable(or any others for that matter) itemStateChanged is called thrice instead of once.

1. Has anyone encountered this problem?

2. If so, what is the solution?

I have included the relevant code below:


public void itemStateChanged(Item item) {
System.out.println("I am in the Kind References Item state changed method. Kind no is:"+myDaf.kindNo);

isDirty = true;

if (item.getClass() == ChoiceGroup.class) {
ChoiceGroup chg = (ChoiceGroup) item;

boolean[] currentSelection= new boolean[chg.size()];

myDaf.previousSelections=new boolean[currentSelection.length];


System.out.println("No of items selected is:"+chg.getSelectedFlags(currentSelection));

//Print out the document

new Echo(this.myDaf.DAFDoc);


isDirty = false; System.out.println("Removed All Children of this kind ref tree");
//Print out the document

new Echo(this.myDaf.DAFDoc); return;

kindFormCurrentItem= this.myDaf.getChangedSelectionIndex(currentSelecti on);System.

out.println("Kind Form Current Item set to:"+kindFormCurrentItem);


//Call a new instance of this class again

if (false==((Hashtable)(this.choiceHashtable.get(chg. getString(chg.getSelectedIndex())))).isEmpty()){

System.out.println("Calling the same class with the next hashtable");
System.out.println("Kind no is:"+myDaf.kindNo);DAKindFormClass nextChoiceList=

new DAKindFormClass("Enter Choice",this.myDaf,(Hashtable) choiceHashtable.get(chg.getString(chg.getSelectedI ndex())));



System.out.println("This hashtable is empty. Kind no is:"+myDaf.kindNo);




System.out.println("Error Not a kind reference choice group");

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

160D0WQ EEPROM Chip (10pcs)/lot
160D0WQ EEPROM Chip (10pcs)/lot  pictureWellon VP598 VP-598 EEprom Flash MCU Programmer USB
Wellon VP598 VP-598 EEprom Flash MCU Programmer USB pictureTOP3000 Programmer 4500+Device for MCU PIC Flash EEprom
TOP3000 Programmer 4500+Device for MCU PIC Flash EEprom pictureWellon VP299 VP-299 EEprom Flash MCU Programmer USB
Wellon VP299 VP-299 EEprom Flash MCU Programmer USB pictureWellon VP598 VP-598 EEprom Flash MCU Programmer USB
Wellon VP598 VP-598 EEprom Flash MCU Programmer USB picture

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