In my project, I have created a Main Screen which displays some database queries data on the Main Screen init method.
Now, here when I created or Edit some more pieces of information in another tab screen and after closing the screen, the edited data is not refreshed in the main screen. I have to log out and log in after to the application to see the changes in the dashboard. is there any way in Cuba to refresh the whole main page instead of logging out and in.
You can use the Timer component to update the desired data sources on the page.
But that’s not always a good idea… You need to be careful not to give a lot of load to the server.
I’ve used the timer component to update as of now. But as you said it’s not a good practice. At least the browser refresh button should work right rather logging out. Should work on Screen Refresh.
Thanks for the update.
Take a look at UI events subsystem: Events - CUBA Platform. Developer’s Manual For instance, you could subscribe main window to event class and fire that event from a window.
If you check com.haulmont.cuba.gui.components.AbstractMainWindow#onUserSubstitutionsChange you will see that main window is updated when you change user substitution list in com.haulmont.cuba.gui.app.security.user.edit.UserEditor#publishUserSubstitutionsChanged.