0

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!

1 Answer 1

1

Set the property valueLiveUpdate on your Input to true.

Documentation can be found here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.