I'm stuck with my little UI5 app. It's a master/detail app with the according 2 views. I want to get access to the selected data set inside the detail controller. The view and the app itself work. I can display the data inside the detail view.
But I need the data in the controller. I spent hours reading and I'm sure it must be very simple.
Inside the detail controller in the handleRouteMatched
I defined a new variable var dataObject = this.getView().bindObject(oPath);
When I debug the dataObject
I see that the data is there (but all data not just the selected). It's deep inside the "undefined"
And I have no clue how to get hold of this. Can someone help?
EDIT:
var sContext = this.getView().oController.sContext; //Retrieve context
var oModel = this.getOwnerComponent().getModel(); // Aquire the model
console.log(oModel.getProperty("/" + sContext + "/Businesstravel"));
That's how I finally got it working. It would have been nice to get the whole record though (not only single fields).