Dear UI5 experts, one question regarding a SAP UI5 worklist application.
In SAP UI5 SDK online help and in several UI5 SCN threads the movement of the binding context of the choosen master view entry to the detail view has been discussed.
Master-Detail, Worklist...
These FIORI floorplans work with an router logic. Using SAP WEB IDE for a worklist, the navigation to the detail is generated.
This always ends up with following code in the detail view/controller:
onInit : function () {
this.getRouter().getRoute("object").attachPatternMatched(this._onObjectMatched, this);
...
}; _onObjectMatched : function (oEvent) {
var sObjectId = oEvent.getParameter("arguments").objectId;
this.getModel().metadataLoaded().then( function() {
var sObjectPath = this.getModel().createKey("MyMessageSet", { Guid : sObjectId });
this._bindView("/" + sObjectPath);
}.bind(this));
};
My requirement is to pickup a specific data column ("Guid") from the actual (in master view selected) context. I want to do this in the onInit-method after this.getRouter()... I did following code:
var bindingContext = this.getView().getBindingContext();
var sObjectGuid = bindingContext.getProperty("Guid");
PROBLEM
========
Chrome-Debugger crashes with second statement:
"Uncaught (in promise) TypeError: Cannot read property 'getProperty' of undefined"
Watchpoint to "bindingContext":
bindingContext: <not available>
How can I simply pickup a column value of the selected (master view) data entry?
Why is the this.getView().getBindingContext()... not working?
I tried also to use this.getView().getBindingContext("MyModelName");
Not working...
Thanks in advance
Klaus Wegener