O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Keeping state after refresh

By default, every time you reload the application on the browser, the init method will be called and all the components will be created again. That means that on every refresh, the components will lose their stored values, or more generally, your application won't preserve its state. For example, if we have an application with a TextField and the user types some text on it before using the infamous refresh button in the browser, the text previously typed in the TextField will be lost forever. The same happens with navigators, as each time we navigate to a view, a refresh will happen in the browser.

In order to preserve the state in our Vaadin applications, we have to create a database and store the value for every component ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required