G4P Reset GCombo choices
in
Contributed Library Questions
•
1 year ago
Hi,
I have a number of GCombo instances, and I want to make their choices dependent on other input. However, I haven't been able to use the removeOption and addOption methods successfully. Creating new instances doesn't seem like the right solution either.
Currently, I am calling removeOption enough times to clear out all the options. In most cases, this is called more than necessary. I do not see a way to query GCombo for the number of items. Then, I call addOption for all the new options. But, only 1 of the new options is added and it is the only option available.
Ideally, I could do something like this:
String[] newOptions = new String[]{"1","2","3"};
myGCombo.setOptions(newOptions);
myGCombo.setSelected(0);
Or, if I can only call removeOption once per existing choice, a method to return the number of existing choice.
Anyone else run into this? Any tips would be great.
tia
bbc
1