on 10-16-2017 12:47 PM
I have created a worklist app with my data in a local json file. I am able to get the data in master page.
On navigation, I am getting the error message as uncaught type error.
The master controller code goes like this
onListPress : function(oEvent) {
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
var oItem = oEvent.getSource();
oRouter.navTo("detail", {
ID: oItem.getBindingContext().getProperty("ID")
});
}
In the controller I am getting value for oItem. For example if i click on first item of the table, it returns table_0-0
Here table_0 is the id of the table.
I have defined the model in manifest.json file.
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "sapui5.demo.mvcapp.i18n.i18n"
}
},
"test": {
"type": "sap.ui.model.json.JSONModel",
"settings": {},
"uri": "service/data.json"
}
}
Please help me to resolve the error.
Thanks in Advance,
Janani
Hi,
I have resolved the error.
Since I am using local json model. In the controller code, I have given my model name in getBindingContext("test") function. It works fine.
ID: oItem.getBindingContext("test").getProperty("ID")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.