ApplicationPortlet2 does Mantain Browser Scroll Position

When dynamically adding new layout component to a Vaadin ApplicationPortlet2; this allways causes the browser to scroll to the top.

The same does not happen, when we execute the application outside of the portal or if we use the ApplicationPortlet (instead of ApplicationPortlet2)

To reproduce this we can use this simple code:

public class MyVaadinApplication extends Application {

    private Window window;

    public void init() {
	window = new Window("My Vaadin Application");

	Button button = new Button("Add button");
	button.addListener(new Button.ClickListener() {

	    public void buttonClick(ClickEvent event) {
		// The following code caused the browser to scroll up when using
		// ApplicationPortle2 on Liferay
		HorizontalLayout layout = new HorizontalLayout();
		Button msg = new Button("MyButton");
		Window main = event.getComponent().getApplication().getMainWindow();


When we click the “Add button”, and having browsers scroll not set to top, it will scroll up
This does not happen if we use ApplicationPortlet, or run it outside of the portal (as a Vaadin Application)

Need some help to try to figure out this different behaviour

Attaching a vaadin application that can be used to reproduce this.

Versions Used

Vaadin Version: 6.6.8
Portlet Container: Liferay 6.0.6
Application Server: GlassFish 3.1.2


Bruno Antunes (7.04 KB)

Upgrading vaadin to version 6.7.8 solves this problem