Reset the Combobox value.

Hi,

I Have a panel with few combo box & text field. I am using a ValuechangeListerner.

whenever user selects value from the combobox & clicks “Save” button, an event is sent and things work fine.

I have another button " Reset". On click of this button i want the combobox to clear i.e setSelected(null).

As of now if i look at , getting the value or setting the value of combobox happens inside teh listener.

Is there a way how i can set it to Null outside the listener, just the way we were bale to do in swings.

Code :

final ComboBox status = new ComboBox(“Status”);
status.addItem(“New”);
status.addItem(“Acknowledge”);
status.addItem(“Suppressed”);
status.setNullSelectionAllowed(false);
status.setImmediate(true);

status.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
// TODO Auto-generated method stub
String statusValue = (String) status.getValue();
}
}

Thanks

Though your question is not so clear to me. But I think you already set “status.setNullSelectionAllowed(false);” if you set it to true , you should be able to setValue(null).

Hope that helps.