VOverlay and Window dragging

Hi,

I extended a TextField, so it can validate userinput and display an error message. I’m using a VOverlay to display the error message like in this example from the wiki: https://vaadin.com/de/wiki/-/wiki/Main/Creating%20a%20component%20extension
The whole validation and error display logic is on the client side.

My problem is now that my TextField is inside a subwindow and when I display the VOverlay and then change the position of the window the VOverlay will of course not move, but stay at its original position.

Is there a way to find out that the TextField is in a subwindow and listen for events when the window changes positions, so that I can move the VOverlay accordingly? Or should I use a whole different approach?

I tried this to get dragging events from the window, but textField.getParent() always returns null.


protected void extend(ServerConnector target) {
	textField = (VTextField) ((ComponentConnector) target).getWidget();
	
	VWindow window = null;
	Widget parent = textField.getParent();
	while (parent != null && window == null) {
		if (parent.getClass() == VWindow.class)
			window = (VWindow)parent;
	}
	if (window != null)
		window.addDomHandler(this, DragEvent.getType());
}