Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

73
Views
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 answers
Answer question

0

Set the property valueLiveUpdate on your Input to true.

Documentation can be found here

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs