Вопрос

I was wondering how to preserve an application when the user leave the application completly by going to another site (for example when the user logs into the application and then goes to nytimes.com and then comes back to the application some components go missing). To preserve the application on a refresh you can use the @PreserveOnRefresh annotation, but this does not preserve the application when you leave it. The header, menu and footer are disappearing. These three components are have their own class and are only declared in the main ui. Each view (or page) has its own class (which sit between the menu and the footer). Everything works fine until the user leaves the webpage and comes back the header, menu, and footer disapear So my question is how to preserve my vaadin application when the user leaves it and comes back?

Это было полезно?

Решение 2

To solve this situation you can add a listener to the navigator which will get the uri to the page you are going to and check your permissions. If you do not have permission it will keep you on the same page and give you a notification saying that you are not allowed to go to this page. If they are allowed you will proceed to direct them to that page.

Другие советы

Well, there could be problem with serialization and deserialization from session. Make sure you have implemented Serialization interface for your own classes.

Have you tried to repaint the missing components? They should be set to setImmediate(false) during repaintRequest.

Anyway, ordinary Vaadin application works without problem after returning back from other url. So good luck.

What components are missing when you go back to the application? Vaadin applicaction lives as long as web session. If I go to nytimes.com and then go back before the web session ends, the Vaadin application will survive (if it has @PreserveOnRefresh) or will be renewed

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top