I want to pass a parameter called 'app' from my Fiori tile configuration to my app and use it in the data binding. I gather dynamic filtering is not possible on the xml view and this question has a suggestion is to use the attachAfterRendering function. I've tried the following code in my view controller but the results are inconsistent, sometimes the data loads correctly, other times I get 'No data'. Any help would be greatly appreciated.
onInit: function() {
var oStartupParameters = this.getMyComponent().getComponentData().startupParameters;
this._oView = this.getView();
this._oView.attachAfterRendering(function() {
var oTreeTable = this.byId("treeTable");
oTreeTable.bindAggregation("rows", {
path: "/Nodes",
filters: [
new sap.ui.model.Filter("Application", sap.ui.model.FilterOperator.EQ, oStartupParameters["app"])
]
});
});
}