cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear ComboBox value on its "Change" event

0 Kudos

I have a ComboBox. I have written a function for its change event, on a particular condition I need to clear the ComboBox selection and its value.

<ComboBox change="onChange"/>
onChange:function(oEvent){ if(someCondition is true){ oEvent.getSource().setValue("") // this trigger the onChange method again //or oEvent.getSource().clearSelection() // this does not clear the value } }

The above solutions have issue mentioned in comment.

Any solution for this ? Or de we have any event which will trigger on ComboBox popup close ?

View Entire Topic
radoslaw_kiela2
Participant
0 Kudos

Hi,

Did you try to call setSelectedKey("") of the combobox?

Br,
Radoslaw

0 Kudos

Yes, I tried. It triggers change event again and that is again the issue.
So I am trying to find an event for ComboBox popup close. This will be the good solution. Any such event you know for ComboBox ?