Refresh data in browse screen programmatically in Cuba Platform 7

Hi,

I’ve built a small app that has a button to update the instances of an entity from an external source (they will be queried from another data store, transformed into entities and persisted). This button is in the browse screen for the concerning entity. After the update has finished I would like to refresh the screen so the actual, updated data is shown in the browse screen.

All solutions I’ve found so far and I’ve used in the past (injecting datasource and refreshing it) do work with Cuba Platform 6, but not in 7. How can I achieve this with the new API 7?

Thanks a lot!

Hi,

You have several options:

  • Inject the corresponding loader and call its load method.
  • Obtain the corresponding loader from screen data and call its load method: getScreenData().getLoader("loaderId").load()
  • Reload all loaders: getScreenData().loadAll()

Gleb

1 Like

Thanks Gleb, exactly what I was looking for, works perfectly! Missed the loader changes yet… :frowning:

Regards,
Max