I have a questions object which contains an answers array
var oModel = new JSONModel({
questions: [{
order: 1,
title: "",
answers: [{
sequence: 1,
label: "Yes",
}, {
sequence: 3,
label: "N/A",
}]
}]
});
And the context set as follows
this.getView().setModel(oModel, "viewmodel");
var oContext = oModel.createBindingContext("/questions/0/");
this.getView().setBindingContext(oContext, "viewmodel");
In my view, I can bind questions fine
<Input value="{viewmodel>title}"/>
However, updating the answers binding updates ALL the answer arrays in EVERY questions context!, e.g. below i'm binding to my current context (questions/0/) but update the label will update the answers for all questions....
<f:Form id="formCustomRadio" editable="true" visible="true" formContainers="{viewmodel>answers}">
<f:layout>
<f:ResponsiveGridLayout/>
</f:layout>
<f:formContainers>
<f:FormContainer title="Answer {viewmodel>sequence}">
<f:formElements>
<f:FormElement label=" {i18n>radioLabel}">
<f:fields>
<Input value="{viewmodel>label}"/>
</f:fields>
Any ideas?