G4P drop down list support

I have a situation where I want to use a textbox, dropdown listbox and two buttons to add, remove names from a string array. I am using g4p and the g4p builder. The g4p builder gives my a list which is stored on Quark website (thanks!) and I want people to be able to enter in new users and remove them as well.

I am a little frustrated that I do not seem to be able to access the string list directly (protected). Here is my code:

public void remove_subject_click1(GButton source, GEvent event) { //CODE:remove_subject_button:855392: println("remove_subject_button - GButton >> GEvent." + event + " @ " + millis()); name_dropList1.removeItem(name_dropList1.getSelectedIndex()); } //CODE:remove_subject_button:855392:

public void add_subject_click1(GButton source, GEvent event) { //CODE:add_subject_button:346637: println("add_subject_button - GButton >> GEvent." + event + " @ " + millis()); name_dropList1.addItem(name_textfield.getText());//.addItem(source.getText()); //name_dropList1.setItems(loadStrings("list_839008"), 0); name_dropList1.setText(name_textfield.getText()); } //CODE:add_subject_button:346637:

I want the added name to be reflected in the dropdown list immediately. Can I access the "list_839008" directly and then reload it? The drop down is created to show 3 entries but only shows 1. I have it starting with a "default" entry. I suppose that g4p could be changing the number of entries to show in the drop down list due to me only having 1 entry to begin with. I guess I could just avoid all this mess and store everything in my own file of options. But any help? Am I missing something?

Also: How can I get the number of options?

Thanks

Tagged:
Sign In or Register to comment.