Closed maxschuster closed 10 years ago
You're right about this. However, the correct way to fix would probably be to use state variable for the timeout value. Then it would not revert to default 5000ms on page refresh even with @PreserveOnRefresh turned on. I'll take a look.
I was thinking about using a state, too, but I was a bit confused by the location of the widgetset (org.vaadin.addons.useractivitytracker). If I create an IdleState should I put it into org.vaadin.addons.useractivitytracker.client or move the widgetset to org.vaadin.addons.idle?
I have moved the timeout property into the shared state by moving the widgetset to org.vaadin.addons.idle: https://github.com/maxschuster/Idle/commit/f4518e89259066e5084fd370625b6834ff418c8d I can create another pull request if you want.
Yes, great. Even it now need ws compilation, this looks pretty much the "right way".
The inactivity timeout becomes 5000 after a page refresh if the UI is annotated with @PreserveOnRefresh. This happens because the javascript function "setInactivityTimeout" is only called in the method "setTimeout"