cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Split App throws getBindingContext(...) is undefined

Former Member
0 Likes
1,188

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)
            );
        },
View Entire Topic
Former Member

Hi Bartosz,

if your List is bound to "masterView" Model, you have to call mParams.firstListitem.getBindingContext("masterView").getProperty("Bukrs")

Best regards,

Christian.

Former Member
0 Likes

Thanks for your reply, but after changing to

var sObjectId = mParams.firstListitem.getBindingContext("masterView").getProperty("Bukrs");
There is still the same behaviour and the same error in the console.
Of course, I've changed all three getBindingContext parts accordingly.