ajayramesh
ajayramesh

Reputation: 3774

Refreshing the screen after entity update from Rest API is not showing latest data?

Steps to reproduce -

  1. I have updated the entity data using CUBA REST API.
  2. I clicked refresh button in browser, it did refresh but the data in entity viewer is still showing old one. So I closed the entity viewer and opened again - it reflects the new changes.

I think the refresh is not working for entity viewer if it is updated by REST API. Is it a bug or any work around is there?

Upvotes: 1

Views: 1049

Answers (2)

ajayramesh
ajayramesh

Reputation: 3774

A quick workaround is to add a refresh button to the UI. Please check below screenshots to add the refresh button. I think that serves the purpose.

  1. When Creating the Generic UI, click on Show advanced properties.

Advanced

  1. Show Advanced Properties > Table Actions > refresh.

enter image description here

  1. Now you can see Refresh button in the web UI, so the user can click refresh button rather than loading the page.

final result

Upvotes: 0

knstvk
knstvk

Reputation: 637

If you mean refreshing the whole page by F5, it doesn't reload your data by the following reason:

  • CUBA generic UI is based on Vaadin, which means it stores the state of all components and data displayed on the page in the web server memory.

  • When you hit F5, your browser just loads this state from the server to the page.

  • In order to reload data from the middleware to the presentation layer, you need to refresh it on the web server, e.g. by reopening the screen.

Upvotes: 1

Related Questions