Closed AswinDC closed 1 year ago
Is the same issue reproducible also with the latest 1.96 patch number (e.g. https://sdk.openui5.org/1.96.23/) or with the latest OpenUI5 snapshot https://sdk.openui5.org/nightly/?
Please share valid steps to reproduce the issue possibly with an OData V4 demo service from https://blogs.sap.com/2017/12/05/new-sap-gateway-demo-system-available/ or with https://services.odata.org/TripPinRESTierService
@boghyon let me check try to consume std. V4 sample service. But it works perfectly if I change the binding as, binding="{/xWUPxWHSetting('BS01')}" But is it possible to change the key parameter BS01 after i do some action?? Kindly help me in a small snippet code since I am not sure which approach should I follow
Response if I use binding as -
binding="{path: '/xWUPxWHSetting', parameters : {$filter : 'Warehouse eq \'BS01\''} }"
binding="{/xWUPxWHSetting('BS01')}"
For the first one i am receiving it under value but for the second one is direct. Kindly let me know how should i change my bindings to use the first one & how to change the parameter's after some action
Thanks & Regards, Aswin.
I just realized your binding definition was applied to binding
while the path: '/xWUPxWHSetting'
refers to an entity set. Please note that the binding
attribute in XML is only for binding a single entity (element binding).
But is it possible to change the key parameter
BS01
after i do some action?
This is bit broad to answer without knowing the context of the application. Please use one of the platforms mentioned in https://openui5.org/community/ for consulting questions in application development.
Hi @AswinDC,
If you want to change the form's binding later, you should not give it a binding
initially. You can always set the binding context dynamically using setBindingContext
, and you can always create a binding context via the model. So, initialize the binding in your controller via
oForm.setBindingContext(oModel.createBindingContext("/xWUPxWHSetting('BS01'))
and later create you can create another binding context (or use one that you got otherwise, e.g. from an action) and set it similarly.
Regards, Uwe
Hi @UweReeder
Thanks for the feedback!!! But how do I perform the oData call after setting the binding context?
What OData call? The GET request for the entity? It will be sent automatically as soon as the binding is resolved (meaning it has a valid OData binding path), which is the case after calling setBindingContext
.
Yeah just now figured it out it does the GET automatically thanks for the response helped me a lot !! :-)
Hi @UweReeder
When i try to change something in the simpleform it tries to automatically update to Backend. How do I stop this? I want to make an update only when clicking on a button Getting this error as well,
This question now is far beyond the original topic of this issue. And I'm afraid a GitHub issue is not meant as a consulting session for various topics regarding application development.
May I refer to @boghyon's comment again? Please use one of the platforms mentioned in https://openui5.org/community/ for consulting questions in application development.
But some hints: My original hint might have been too short. Your form probably needs a binding with empty path: binding="{}"
. And have a look at updateGroup
in ODataModel
.
OpenUI5 version:1.96.10
Browser/version (+device/version): Chrome
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible):
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
What is the expected result?
What happens instead?
Any other information? (attach screenshot if possible)
Trying to pass filter parameters for direct binding of the form elements. And I also have a question here is it possible to change the binding dynamically in controller i want to change the B701 to something else when some action happens.. kindly provide an example
Getting this below error in console: