0
votes

In my code i have two Comboboxes. When the item in the first combobox selected, related options will be displayed in the second combobox.

Ex: combobox1 Combobox2 options

   A              1, 2, 3, 4    --> 2 is selected

   B              5, 6, 7, 8

Initially i selected the A option in combobox 1 with value 2.

When i tried to select the B option in combobox 1, still it is showing the value 2 in combobox 2.

How to clear the previous selected item in the combobox 2 ?

I have tried with both selection_clear() and Options_clear(), but it doesn't work for me.

Can any one suggest how to clear the previous selected item in the combobox2 ?

2

2 Answers

0
votes

try using combobox.databindings.clear() for the combobox binding

0
votes

set the default text for combobox 2 when you click the option in combobox 1.

Ex: combobox2.set("Select one number")

Here it will set the default instead of previous selected one.