Hi
I've created a split app and called OData to display a list in the master page.
Now I'm trying to navigate from the master page list items to their details.
This is the code:
MasterView.contoller.js
onListItemPress : function(evt) {
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
var selectedSwapN = evt.getSource().getBindingContext()
.getProperty("Swapn");
oRouter.navTo("DetailView", {
Swapn : selectedSwapN
});
sap.m.MessageToast.show(evt.getSource().getBindingContext()
.getProperty("Swapn") );
}
DetailView.controller.js
onInit: function () {
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.getRoute("DetailView").attachMatched(this._onRouteMatched, this);
},
_onRouteMatched : function (oEvent) {
var oArgs, oView;
oArgs = oEvent.getParameter("arguments");
oView = this.getView();
oView.bindElement({
path : "/ET_SWAPSet(" + oArgs.Swapn + ")",
events : {
dataRequested: function () {
oView.setBusy(true);
},
dataReceived: function () {
oView.setBusy(false);
}
}
});
}
Manifest.json
"routing": {
"config": {
"viewType": "XML",
"viewPath": "ZMOB_BDJS_PENDING_APPROVAL.view",
"targetAggregation": "detailPages",
"clearTarget": false
},
"routes": [{
"pattern": "",
"name": "",
"view": "MasterView",
"targetAggregation": "masterPages",
"targetControl": "splitapp",
"subroutes": [{
"pattern": "DetailView/{Swapn}",
"name": "DetailView",
"view": "DetailView",
"targetAggregation": "detailPages"
}]
}]
}
I'm able to get the selected item but I'm having issue with displaying the details.
The error I'm getting is with pattern I've added in the subrouts.
"pattern": "DetailView/{Swapn}"
This is the error:
The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"005056A509B11EE1B9A8FEC11C22778E","message":{"lang":"en","value":"Invalid key predicate type for 'Swapn'. Expected type is 'Edm.String'"},"innererror":{"transactionid":"325456E77FEFF15E811700505680552C","timestamp":"20170621073530.0200000","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"}}}}
I've checked the key type which is Swapn in the OData and it is Edm.String

How can I fix the issue?
Thanks