on 09-08-2017 9:00 PM
I have 2 separate views, each with their own controller.
First view is the first "Part" of a survey, second view is the rest.
I have a model view setup for each, but is is possible to pass the details of the First page's model to use in the second?
I know you can include parameters in routing but they're large text fields in this case.
The other option I have is to save the details in the back-end and only pass over a reference number of the created model as a parameter.
Any other thoughts?
To exchange the entire data model between views you can set the model to Component instead of global core
From best practice, please do not use global core.
Below code snippet may help you
// Set the log model to the Component
var logModel = new sap.ui.model.json.JSONModel();
logModel.setData(data);
this.getOwnerComponent().setModel(logModel, "jsonLogs");
In other view
var oModel = this.getOwnerComponent().getModel("jsonLogs");
oModel.getData();
Thanks,
NP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many thanks 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To exchange the entire data model between views you can set the model to Component instead of global core
From best practice, please do not use global core.
Below code snippet may help you
// Set the log model to the Component
var logModel = new sap.ui.model.json.JSONModel();
logModel.setData(data);
this.getOwnerComponent().setModel(logModel, "jsonLogs");
In other view
var oModel = this.getOwnerComponent().getModel("jsonLogs");
oModel.getData();
Thanks,
NP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got your point, I will give my suggestion to you.
1) use global model. (sap.ui.getCore().setModel(<YOUR JSON MODEL>, "REFERENCENAME"))
2) use the reference name in your second page. like( new sap.m.Text({ text: "{REFERENCENAME>/Property}"}))
Regards,
AK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why you do not use a global model (in the manifest) ?
Regards,
Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.