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.
Hi @CJN ,
After you do all the stuff you've implemented on step 2, call method 'refresh' on the odata model:
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: