cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 Date Picker/combo box - disable editing in the control

0 Kudos

Hi,

I want to disable the editing in the Date picker and combo box selection should only happen with calendar in case of date picker and drop down in case of combo box . how to achieve this?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Kranthi,

I had the same problem.This is how i resolved the issue.After the combobox code insert below code

comBoboxName.onAfterRendering = function() {

            if (sap.m.ComboBox.prototype.onAfterRendering) {

              sap.m.ComboBox.prototype.onAfterRendering.apply(this);

            }

            document.getElementById("<comBoboxId>-inner").disabled=true;

        }

give credits if helpful.

SAP UI5 combo box - disable editing in the control | sap abap | sapui5 made easy

Regards

Former Member
0 Kudos

Hey Kranthi,

Use Editable property ....

setEditable = false

Might this help you.

Cheers,

Viplove Khushalani

bradp
Active Participant
0 Kudos

Hi Kranthi,

Did you ever find a solution to this?

Cheers,

Brad

koolspy_ultimate
Active Contributor
0 Kudos

Hi,

Did you try using

(var).setEnabled(false);  //true

Regards,

Madhumahesh.

0 Kudos

That did not work, it disables even the calendar and input both which I do not want.. I want only input to be disabled.

koolspy_ultimate
Active Contributor
0 Kudos

HI,

Get the context and only for that context use the above syntax.

Regards,

Madhumahesh.

0 Kudos

Hi,

Can you please elaborate? how to get the context..

I can only read the binding context for this UI

Regards,

Kranthi

koolspy_ultimate
Active Contributor
0 Kudos

Hi,

Are you using id's for the both right?

So using id get the corresponding control and , to this control set the setEnabled Property.

Regards,

Madhumahesh.

0 Kudos

Hi,

I tried setEnabled and setEditable in all combinations on the control still it is not working.

as I said it either disables both input and calendar or enables both...

koolspy_ultimate
Active Contributor
0 Kudos

Hi,

Can you please post your code, it might be useful to help you .

Regards,

Madhumahesh.