on 02-19-2019 10:58 AM
Hi all,
I downloaded the demokit example:
and uploaded it into my workspace.
I added a Button in the view with
press = "onInsert".
In the controller.js I wanted to read the model when the button was clicked:
onInsert: function (oEvent) {
//Create
// https://archive.sap.com/discussions/thread/3605897
var oModel = sap.ui.getCore().getModel();
The view works fine:
But the model is empty (aBindings contains nothing)
It seems that I also have to bind/publish the model to the controller? Is that true?
How do I have to do this?
Many Thanks
Regards
Mario
In that example, model is set in the component using the sytax: this.setModel();
so in the view, you should access like show below:
this.getOwnerComponent().getModel();
or this.getView().getModel()
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.