on 11-16-2021 10:13 AM
Hello experts,
I have been trying to create a view that would load data from more than one model, one model is a created model, one is a model from somewhere else in my code.
I have them both included in the controller function, but when I try to create them, I get an error where whichever model is listed second won't load.
Is there a way around this? Appreciate your help.
function (Controller, JobHistoryModel, JSONModel, MessageToast) {...
this.getView().setModel(
new JSONModel({
isListBusy: false,
}),
"dataModel"
);
this.getView().setModel(new JobHistoryModel(), "JobHistoryModel");
Hi Callum,
you need to include the namespace for the JSONModel
sap.ui.define([
...
'sap/ui/model/json/JSONModel'
]
, function(
.... ,
JSONModel
) {
return ....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
11 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.