openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.DatePicker: Reset via databinding is working only for the first time

Open GKSoftwareDevelopment opened this issue 8 years ago • 2 comments

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:

  1. Fill some invalid value like into datePicker 11111111111
  2. Click somewhere else (to trigger validation) -> datePicker is marked as red
  3. Click on Reset button -> value in datePicker is correctly removed
  4. Fill again some invalid value
  5. 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);

GKSoftwareDevelopment avatar Nov 29 '18 13:11 GKSoftwareDevelopment

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

GeorgiValkanov avatar Nov 29 '18 14:11 GeorgiValkanov

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

adrian-bobev avatar Jan 07 '19 10:01 adrian-bobev