on ‎2018 Oct 26 10:44 AM
Hi,
I'm creating a simple Split App using a template.
Because of the OData service specification, I had to make some changes to the manifest file and in the master.controller as well.
While starting the app I'm receiving
TypeError: mParams.firstListitem.getBindingContext(...) is undefined
In the console.
What am I doing wrong and how to repair this bug?
The manifest file and other parts of the app are good because the navigation works fine if I click anything on Master list, but it can't show first list element details by default.
Here is the code of problematic functions:
onInit: function() {
var oList = this.byId("list"),
oViewModel = this._createViewModel(),
iOriginalBusyDelay = oList.getBusyIndicatorDelay();
this._oList = oList;
this._oListFilterState = {
aFilter: [],
aSearch: []
};
this.setModel(oViewModel, "masterView");
oList.attachEventOnce("updateFinished", function() {
oViewModel.setProperty("/delay", iOriginalBusyDelay);
});
this.getView().addEventDelegate({
onBeforeFirstShow: function() {
this.getOwnerComponent().oListSelector.setBoundMasterList(oList);
}.bind(this)
});
this.getRouter().getRoute("master").attachPatternMatched(this._onMasterMatched, this);
this.getRouter().attachBypassed(this.onBypassed, this);
},
_onMasterMatched: function() {
this.getOwnerComponent().oListSelector.oWhenListLoadingIsDone.then(
function(mParams) {
if (mParams.list.getMode() === "None") {
return;
}
var sObjectId = mParams.firstListitem.getBindingContext().getProperty("Bukrs");
var sObjectId2 = mParams.firstListitem.getBindingContext().getProperty("Auditid");
var sObjectId3 = mParams.firstListitem.getBindingContext().getProperty("Commiteeid");
this.getRouter().navTo("object", {
objectId: sObjectId,
objectId2: sObjectId2,
objectId3: sObjectId3
}, true);
}.bind(this),
function(mParams) {
if (mParams.error) {
return;
}
this.getRouter().getTargets().display("detailNoObjectsAvailable");
}.bind(this)
);
},
Request clarification before answering.
Hi Bartosz,
if your List is bound to "masterView" Model, you have to call mParams.firstListitem.getBindingContext("masterView").getProperty("Bukrs")
Best regards,
Christian.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.