on 11-13-2017 1:25 PM
I have a "questions" object which contains an "answers" array...
<code>var oModel = new JSONModel({
questions: [{
order: 1,
title: "",
answers: [{
sequence: 1,
label: "Yes",
}, {
sequence: 3,
label: "N/A",
}]
}]
});
And the context set as follows...
<code> this.getView().setModel(oModel, "viewmodel");
var oContext = oModel.createBindingContext("/questions/0/");
this.getView().setBindingContext(oContext, "viewmodel");
In my view, I can bind questions fine...
<code><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 updating the label will update the answers for all questions....
<code><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?
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.