Window shadow stays after removing from application window

I have a couple of sub-windows that get added to and removed from my main application window. Most of them work as expected when being added and removed. However, one of them leaves the shadow behind when it is removed. The window does disappear, but the shadow stays. The shadow is not movable or resizable or anything.

I suspect that the problem lies in how I am creating the sub-window or adding it to the main window because the sub-window’s shadow is left behind whether I remove it with code or with the “X” in the window’s title bar.

Prior to removing, it returns true when I check to see if it is a child of the main window:

mainWindow.getChildWindows().contains(subWindow)

and when I actually remove it, the remove method returns true:

mainWindow.remove(subWindow)

Here is how I am configuring the window that will eventually be removed:

    subWindow.setCaption("blah blah");
    subWindow.setWidth(mainWindow.getWidth()
        - 200);
    subWindow.setHeight(mainWindow.getHeight() - 100);
    subWindow.setPositionX(100);
    subWindow.setPositionY(20);
    subWindow.setResizable(false);
    subWindow.setScrollable(true);

I know that I am using a deprecated setWidth and setHeight, but I doubt that is the problem.

Here is how I am adding it to the main window:

mainWindow.addWindow(subWindow);

I can’t think of what I could be doing wrong.

Does anybody know what types of things could cause this behavior or how I could investigate this issue?

Also, I confirmed that mainWindow.getChildWindows() is empty after removing the sub-window whose shadow remains behind.

Also note that the shadow covers whatever is below it, so nothing below it can be clicked.

Sounds like a bug that was fixed not too long ago (some JS error when the window is being removed, hence the shadow not being properly removed).

What version of Vaadin are you using? If not the latest, does it help if you update to a newer version?

I was on 6.5.1, but I just upgraded to 6.6.1 and the problem still occurs.

I’d like to confirm that I correctly upgraded to 6.6.1. I’m using Vaadin in Eclipse, so I did the following:

  • Open the project properties
  • Go to the “Vaadin” section
  • Click the “Download” button next to “Vaadin version”
  • Select “6.6.1”
  • Click Ok
  • Let it do its thing
  • Let it rebuild the widgetset

I also checked for and installed updates under the Help menu in Eclipse.

Is there something else I have to do in order to upgrade?

If not, can you think of where I should focus my testing in order to find the problem?

The problem occurs regardless of whether I do or do not call any of the following:

  • setResizable
  • setPositionX
  • setPositionY
  • setWidth
  • setHeight
  • setModal
  • setScrollable

I have more information.

The problem is occurring because I am adding a com.vaadin.incubator.dragdroplayouts.DDVerticalLayout to the Window. When I change that component to a VerticalLayout, the shadow successfully goes away when the window is closed.

Within the DDVerticalLayout, all I am doing is the following:

  • setDragMode
  • setDropHandler
  • setSizeFull
  • setSpacing(true)

Does this give you any ideas about things for me to look into?

As an aside, I am using a DDVerticalLayout in a different window and it works fine.

Here is the code for the window that works (FieldToolbox extends DDVerticalLayout):

    final Window window = new Window();
    window.setCaption(FIELD_TOOLBOX_WINDOW_CAPTION);
    window.setWidth(110);
    window.addComponent(FieldToolbox.getInstance());
    window.setResizable(false);
    window.setPositionX(20);
    window.setPositionY(20);

So since it is working in one case, the problem seems to be specific to how I am using the DDVerticalLayout in the other case.

Hi,

Thank you for pointing out this issue. Indeed it was a problem with DragDropLayouts causing a Javascript error when the Window was removed.

It has now been fixed and updating to the latest
DragDropLayouts 0.5.1
should fix the issue.

PS. Remember to recompile your widgetset after you update the addon.

Thank you, that solved it.

I guess next time I’ll take a look at JavaScript errors…oops…