openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

TimePicker validation, access to previous value in change event

Open alex-ecenta opened this issue 9 years ago • 5 comments

Is there a way to get the previous value of a TimePicker in a change event?
The event object for TimePicker has a field called prevValue but it's equal to the currently selected value.
We'd like to validate the time a user inputs through the TimePicker with a custom validation method.
It seems that Input provides such an option with liveChange, but TimePicker extends MaskedInput, which extends InputBase, which does not have the liveChange event.

alex-ecenta avatar Jun 12 '17 10:06 alex-ecenta

Hi @alex-ecenta,

thanks for the reported issue! I've created a internal ticket (1780198878) and dispatched it to the responsible colleagues.

You can check its status on GitHub.

Regards, Clemens

clemai avatar Jun 14 '17 09:06 clemai

@alex-ecenta what exactly you to validate? If you could elaborate a bit more on your use case that would be helpful for us to understand better your requirement.

vladimir-velinov avatar Sep 05 '17 13:09 vladimir-velinov

@vladimir-velinov We want value that the user selects to be assigned, only if the case if it is valid, based on our validation logic, implemented in our validation method, e.g. that the time falls in between a range of other times. If it fails, we would like to keep the previous value in the control.

alex-ecenta avatar Sep 05 '17 13:09 alex-ecenta

Hello @alex-ecenta , Thank you for share your findings. I've created an becklog item. The status of the issue will be updated here in GitHub. Regards,

GerganaKremenska avatar Oct 05 '17 11:10 GerganaKremenska

Hi,

You can try using the following code: http://jsbin.com/nawunesite/edit?html,output

Best, Teo

TeodorTaushanov avatar Nov 03 '17 11:11 TeodorTaushanov