MJBZA
MJBZA

Reputation: 5018

What is the reason for receiving "It is not supported to change the behavior at runtime." error in SAPUI5 application

I have a SAPUI5 application and when I press on items to visit the detail or object page it shows the following error message in the following part of the code

It is not supported to change the behavior at runtime.

showObject: function(oItem) {
    var sObjectId = oItem.getBindingContext().getProperty("Partner");
    this.getRouter().navTo("object", {
        objectId: encodeURIComponent(sObjectId)
    }, false);
},

Upvotes: 0

Views: 272

Answers (1)

Matthew C Reddy
Matthew C Reddy

Reputation: 332

Are you sure that's where you're getting it? I've only seen that error when working with certain controls the UploadCollection and trying to fire a method like oUploadCollection.setUploadUrl("/url") which is not supported at runtime.

Without setting a property and given the code above, the error doesn't make sense.

*A side note: without seeing where your showObject method is called, it's hard to say... but if showObject is called directly off the press event of the ListItem you need to call getSource() on the event object. Might be throwing an error there about getBindingContext() not being a function.

Upvotes: 1

Related Questions