Help on frequent Out of sync


I am new to Vaadin framework.
I have created a very simple Vaadin application which displays a notification message whenever a button is clicked.

public class VaadintestApplication extends Application {
	public void init() {
		Window mainWindow = new Window("Vaadintest Application");		

		Label label = new Label("Name");

		final TextField nameTxtField = new TextField();
		getMainWindow().addComponent(new Button("Notify", new Button.ClickListener() {
			private static final long serialVersionUID = 1L;

			public void buttonClick(ClickEvent event) {
				getMainWindow().showNotification("Notified " + nameTxtField);


If I access the application using a single browser window, everything works perfectly fine.
I get “Out of sync” error when I follow following steps:
1) Open a browser window and access the application → the application gets loaded
2) Open another browser window and access the application → the application gets loaded
3) Now go to the “first” browser window and click on “Notify” button it displays “Out of sync” error message.

I have not performed any action but I get this error message.

What can be the reason for this message? Is this how all Vaadin applications work?



Override getWindow() in your application, something like

    public Window getWindow(String name) {
        Window w = super.getWindow(name);
        if (w == null) {
                w = new MyFooBarWindow(); // it's best to have separate classes for your windows
        return w;

Book of Vaadin also contains more on the subject, as do numerous forum posts.

Best Regards,

Thanks Marc
It works fine.
It also explains why application cannot retain its state in the new browser window.