Same vaadin window in many browser's windows

Hi

First question is: does Vaadin support using same windows in many browser windows?
I have read article about multiple windows (
Application windows
) and made many tests but I couldn’t force Vaadin to show proper windows without synchronization problems :confused: Here is my code:

I have 2 application windows - Login and Main. Login contains only button with listener:

loginButton.addListener( new ClickListener() {

	@Override
	public void buttonClick( ClickEvent event ) {
		AuthWindow.this.app.createMainController();
		AuthWindow.this.open(
			new ExternalResource(
			AuthWindow.this.app.getURL() + "Main" ) );
	}
} );

Overrided getWindow method in application class:

public Window getWindow( String name ) {
  Window result = super.getWindow( name );
  if( result == null ) {
  	if( name.equals( "Main" ) || name.startsWith( "Main_" ) ) {
  		result = new MainWindow( this.mainController );
  	} else {
  		result = new AuthWindow( this , null );
  	}
  	result.setName( name );
  	this.addWindow( result );
  }
  return result;

And generaly it works but I still get synchronization error when doing these steps:

  • Open application: http://localhost:8080/App/ (1st window)
  • Open application in second window: http://localhost:8080/App/ (2nd window)
  • Click Login button in 1st window - main window opens correctly
  • Click Login button in 2nd window - main window opens correctly
  • After making any action in 1st window (click some button etc) I get synchronization error :/.

I tried many things (even stupid ones) like:

  • opening generated main window address in Login button’s listener.
  • Creating new windows on EVERY request.
  • etc
    Nothing solved the problem.

That’s why I am wondering is it possible to have opened many windows in browser using same URL. According to what’s written in mentioned article - it is, but I couldn’t do it :/.

Vaadin version: 6.3 snapshot - vaadin-6.3.0.nightly-20100203-c11122.jar
System: Windows XP SP3
AppServer: GlassFish 2.1

Thanks for Your help in advance.

Radek

I think I solved the problem (at least it looks like :slight_smile: ). After creating new window in getWindow method, new window’s name must be generated (no name assigned (then random generator comes to play) or creating some random name by myself (e.g. UUID.randomUUID().toString()).

So far, so good