I have a SAPUI5 split-app with a master- and detail-view.
When I select an item in the side bar, I pass the context to the detail view, lets say product 1
onSelectProduct: function(evt){
sap.ui.getCore().getEventBus().publish("app", "refreshProductDetail", {context : evt.getSource( ).getBindingContext()});
},
this triggers following function which binds the context:
refresh: function(channelId, eventId, data){
if (data && data.context) {
this.getView().setBindingContext(data.context);
}
},
Now when I perform an action like save, I want to get the current data of product 1 that is in the model.
However, when I use
this.getView().getBindingContext().getModel()
it returns the model with all the products. How do I know which one is currently being viewed by the user?