Skip to Content

sap.m.DatePicker issue

Nov 23, 2016 at 09:28 AM


avatar image
Former Member

Does anyone know how to make the SAPUI5 control sap.m.DatePicker read only? I would like to be able to show the standard calendar UI to the user if he clicks on the little calendar icon but the user shouldn't be allowed to actually change the date. I am try js view for designing.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Akhilesh Upadhyay Sep 09, 2017 at 08:51 PM

I think below work around would work, perform below 2 tasks,

1) disable pointer focus in input using below css code,

.sapMInputDivWrapper {
    pointer-events: none;

2) you must have previous date value somewhere in the model property or a variable, keep this, and implement 'change' event of datepicker and return/set previous value only instead of changed value.

hope this works!

10 |10000 characters needed characters left characters exceeded