cancel
Showing results for 
Search instead for 
Did you mean: 

Binding Context creating a generic binding object rather than an oData V4 binding

Hello,


I am having trouble with the binding contexts in a Fiori app originally generated in Fiori Elements. In a controller extension I cannot access attributes from an oData v4 service. The service has been added in the manifest, and i nthe controller extension the binding looks as follows (where responseService is the service added in the manifest):

var oBindingContext = oResponseModel.createBindingContext(fullPath);
oDialog.setBindingContext(oBindingContext, "responseService");

After doing this, in the ModelContextChange event, I get the new binding context as follows:

 var oContextBinding = oDialog.getBindingContext("responseService");

After this, I would expect oContextBinding to have the method requestAttribute( ), but that is not available. The object returned by getBindingContext is a generic binding object rather than an oData v4 binding. Is there a way to force the binding to be of that type? Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

marcel_waechter
Advisor
Advisor
0 Kudos

Hi,

if I understood you right you can't use the model/service used for the page but want to use a separate service/model.

Can you use bindContext instead of createBindingContext?

var oBindingContext = oResponseModel.bindContext(fullPath);

This will return you a v4 context and you can use it to request properties with the requestProperties method (not requestAttributes)

Best regards,
Marcel