on
2024 Feb 12
1:20 PM
- last edited on
2024 Feb 14
8:10 AM
by
AnnePetteroe
Hi experts,
I have an CAP application, and I have implemented the following logic by it:
1. on the list report page, enter some Filters: a,b,c, then click "GO" button
2. based on filters that I entered, I call an external service to retrieve some data and then write these data to CAP temp database during the test
3. Now I got issue, after clicking "GO" button on step 1, step 2 will be implemented and data will be stored successfully, BUT not displayed immediately on the UI list. If I click "GO" button again, these stored new data will be displayed. So, in total, I have to click "GO" button twice to refresh and display the data.
Some of my ideas are: a) resend the ODATA Batch request to the server (as I see every time I click "GO", a batch request will be sent.) I have tried this with basic auth (my SID and password), but always get 401, have no idea how to deal with this.
b) auto refresh the page or rebind the table after clicking go and storing the data, I have tried with extension API on controller, but it did not work.
So I would like to ask if there are some solutions for this.
Thanks!
Request clarification before answering.
Hi @CJN ,
After you do all the stuff you've implemented on step 2, call method 'refresh' on the odata model:
https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.model.odata.ODataModel%23methods/refresh
Depending on how you have bound your data model to your view (one-way or two-way) your UI will get the updated data after its bound model gets refreshed. Please review the following links:
https://sapui5.hana.ondemand.com/sdk/#/topic/68b9644a253741e8a4b9e4279a35c247
https://sapui5.hana.ondemand.com/sdk/#/topic/c72b922fdb59422496661000165d7ff1
https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.model.Model%23methods/setDefaultBindingMode
Best regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
21 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.