0

I am developing an application that provides a List of items to user on the basis of choosen category from ComboBox. I am implementing this in lwuit. The problem is , when i change the selected item from ComboBox, the updated list do not appear on screen. How to refresh the List within the screen. and the selected item from ComboBox must be maintained when the user comes back to this Form.

Mun0n
  • 4,438
  • 4
  • 28
  • 46
Dania
  • 1,007
  • 1
  • 14
  • 21

1 Answers1

1

1)Add an selection listener on the combo box (combox.addselectionlistener(new Sele....))

2)get the selected item and its index on the event of selection changed

3)Assign a new data source to your list based on the selection with :

yourList = new List(java.lang.Object[] items);// this can be an array of strings.

so if you have 3 items in combo box, you should have 3 different string arrays for each item of the combo box.

4) When the user comes back to the form, set the selected item as :

combox.setSelectedIndex(index of that item here)
Nikhil
  • 1,279
  • 2
  • 23
  • 43