-3

I am using OpenUI5 and I want to disable an input field. I've already tried the following, but it is not working:

sap.ui.getCore().byId("xxx").setDisabled(true)
Jaro
  • 1,757
  • 1
  • 15
  • 36

2 Answers2

1

The input control does not have a 'disabled' property so the setter setDisabled will not work. However it does have a enabled property so you could use the setEnabled method.

sap.ui.getCore().byId("xxx").setEnabled(false); //Disables the control
Stephen S
  • 3,936
  • 2
  • 23
  • 33
1

If you want to prevent the user from editing the Input value, you should set it's editable property to false using the Input's method setEditable(false).

Volk64
  • 33
  • 6