on 05-03-2023 8:05 PM
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.