My Fiori application has a view for which two models are set. The first model is set by default in manifest.json (OData), the second model I set in the controller.
The data of the second model are displayed in sap.m.TextArea. If I try to get its binding context, the output is undefined.
This is how I set second model:
onInit: function() {
var oLocalModel = {
Text: "test"
};
// JSONModel required from "sap/ui/model/json/JSONModel"
var oModel = new JSONModel(oLocalModel);
this.getView().setModel(oModel, "localData");
},
This is how I try to get the binding context of the TextArea:
onSendMail: function(oEvent) {
var oLocalContext = oEvent.getSource().getBindingContext("localData"); // undefined
var oLocalContext = this.byId("zgutMailFormText").getBindingContext("localData"); // undefined too
},
<TextArea id="zgutMailFormText" value="{localData>/Text}">
<layoutData>
<l:GridData span="XL2 L3 M3 S8" />
</layoutData>
</TextArea>