Vaadin Reloading the Application

Hi,

I am writing a vaadin app similar to the code below,if I open this code in a tab in my browser (i am using chrome) and click the button, it removes all components from the mainWindow as I would expect. If I open a new tab in my browser this tab also displays the window with all components removed. Is it possible for me to invoke a re-initialization in this new browser tab?

The reason I am doing this is that, I am attempting to write a proof of concept app to enable dynamic initialisation in my vaadin app, but at the moment the initialisation appears to be depdendent upon the state of the window when the app was last used.



public class MytestApplication extends Application {

	public void init() {
		
		   final Window mainWindow = 
		      new Window("Myproject Application");

		   Label label = new Label("Hello Vaadin user");
		   mainWindow.addComponent(label); 

		   final Panel p1 = new Panel();
		   p1.addComponent(
				      new Button("Click me I am panel 1!!!", new Button.ClickListener() {
						public void buttonClick(ClickEvent event) {
				            mainWindow.showNotification(
				               "The time is " + new Date());
				         }
				      }));
		   
		   final Panel p2 = new Panel();
		   p2.addComponent(
				      new Button("Click me I am panel 2!!", new Button.ClickListener() {
						public void buttonClick(ClickEvent event) {
				            mainWindow.showNotification(
				               "Panel 2: The time is " + new Date());
				         }
				      }));
		   
		   mainWindow.addComponent(p1);
		   mainWindow.addComponent(p2);

		   mainWindow.addComponent(
				      new Button("What is the time?", new Button.ClickListener() {
						public void buttonClick(ClickEvent event) {
				         
							mainWindow.removeAllComponents();
				         }
				      }));
		   
		 setMainWindow(mainWindow);
		}
}

I found a way to do this in section 4.1 of the vaadin book.

“Adding the ?restartApplication parameter in the URL tells the Vaadin servlet
to create a new Application instance on loading the page. If you also include a URI
fragment, the parameter should be given before the fragment”