Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

74
Vistas
Updating sap.ui.model.json.JSONModel on Input Change

I have the following problem:

I have created a JSONModel with data in my SAPUI5 application. After that I created an input field, which got as model the just mentioned JSONModel. The value of the input field is bound to the model.

Now when I start the application, the initial value from the model is written to the input field. But if I now change the value in the input field, it will not be adjusted in the model. Only when I confirm the value in the field with Enter, it works. Can I work around the fact that I have to press Enter after changing a value?

var oModel = new sap.ui.model.json.JSONModel();
oModel.setDefaultBindingMode(sao.ui.model.BindingMode.TwoWay);
oModel.setData({
    test_value: "Hallo"
})

var oInput = new sap.m.Input({
    value: "{test_value}"
})
oInput.setModel(oModel);

Thanks for your help!

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Set the property valueLiveUpdate on your Input to true.

Documentation can be found here

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos