sap.m.DatePicker: Reset via databinding is working only for the first time
OpenUI5 version: 1.52.5, 1.60.1 (and probably others)
Browser/version (+device/version): Not connected to browser (tested on Firefox 63 and Chrome 70)
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible): https://jsbin.com/lasicepiza/edit?html,console,output
Steps to reproduce the problem:
- Fill some invalid value like into datePicker 11111111111
- Click somewhere else (to trigger validation) -> datePicker is marked as red
- Click on Reset button -> value in datePicker is correctly removed
- Fill again some invalid value
- Click on Reset button
What is the expected result? Value from datePicker is removed
What happens instead? Value remains here.
Any other information? (attach screenshot if possible) Workaround for this issue exists: set value undefined to the model after setting null
See:
sap.ui.getCore().getModel().setProperty('/stringValue', null);
sap.ui.getCore().getModel().setProperty('/stringValue', undefined);
Hello @GKSoftwareDevelopment , Thank you for sharing this finding. I've created an internal incident 1870493647. The status of the issue will be updated here in GitHub. Regards, Georgi
Hello @GKSoftwareDevelopment,
I have updated your example. Actually you do not need to use the workaround described in your report.
When you update a property in the model by setProperty you should update the bindings by calling updateBindings method
You can check the working example: https://jsbin.com/yagezoqusi/1/edit?html,output