How to clear a DatePicker


Question

I have a DatePicker for selecting birthday.

This is going to be used for some filtering, and after the filtering, I will like the value to be reseted, i.e. the DatePicker should go blank.

Any help???

1
5
4/10/2015 4:56:27 PM

Accepted Answer

If you want to clear the TextField of the DatePicker, you can use :

datepicker.getEditor().clear();

If you want to clear the value and the textfield, use :

datePicker.setValue(null);
22
9/21/2014 10:02:29 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon