Hello experts,
I need your opinion about the next issue: Is it possible that there is now way to initially filter oData service with variable in XML views?
Let me explain why I need that. We have Gateway as separate server and it is connected with our Development and Production ERP systems with RFC connections. On Gateway, we develop oData services from custom RFC functions (for our custom programs) from those systems and every service have import parameters.
I know that in SAPUI5 application I could filter directly in XML like this for example:
Filter "Partnid" represent id of the user that will log to application so it has to be dynamic value or variable. And that is just one of many services that I will use in this application. I try to filter in onInit method in view controller like this:
var oBinding = this.byId("list").getBinding("items"); | |||
oBinding.filter([new sap.ui.model.Filter("Appid", FilterOperator.EQ, "1000"), new sap.ui.model.Filter("Partnid", FilterOperator.EQ, "1000000147")]); |
but it's not working.
Is there any way I could do that in view Controller or elsewhere, or I must use JavaScript views?
PS:
Please don't just provide links but try to explain. Thanks.