Vaadin UI @PreserveOnRefresh issue with Liferay.

I have an application with two UI class.
One UI is for
“About Us”
and another is for
“Contact Us”
and both are one one
portlet for liferay
I have made both the UI as
If I have edited some field in
“Contact us”
and pressing refresh button the edited field datas are still exist. Its working as it should.

But the problem is there with portlet change. After editing the fields in
“Contact Us”,
if I am navigating to
“About us”
by clicking portlet menu and again coming back to
“Contact Us”
, Still the eddited fields having value. [b]
It should load fresh. But It preserving the old field values.

Anybody please suggest somthing to fix it…

If you are using @PreserveOnRefresh it will maintain the UI state as long as the session is alive - even between page reloads. If you don’t want this behavior, you should not use the annotation.

The requirement is when I will refresh the page it should maintain the UI state. But when I am navigating to another portlet, it should not preserve the state when I am re navigating to old portlet.

Ok then. I’m not sure how is navigation done in your application, but overall, you would need to catch that navigation event separately and pass it to the UI. Maybe close the UI altogether, or simply just reinitialize data. Otherwise it looks simply like a page reload to the portlet and it will keep the state.

In case of liferay there is no portlet change listener. So I can not get any navigation event. And the most interesting thing is, I have not given any @PreserveOnRefresh anotation but my UI is preserved on refresh and refresh() is executed. I am fully new to Liferay.
Do you have any idea how is it preserved?