Custom Layout Widgets - Infinite Loop LayoutManager Exception

Hey!

This is my first post and I would like to say “Hello” to you all!
I really appreciate working with Vaadin and I love the changes for Vaadin 7 especially the fixed layouts!

My problem is the following:
I am developing a Custom Layout Widget that implements SimpleManagedLayout at the moment.

I use the layout() method to retrieve the width of the layout and simply call getWidget().doLayout( newwidth ) to perform necessary layouting caused by width changes.

Besides asking for the height of child components in the doLayout() method, the Layoutmanager is not involved further.

I experience serious problem when having multiple instances of the layout on the page or nested in each other.

When resizing the browser window I often see
“Layout has been measured 3 times”
in the console, when it’s getting worse I get
“Layout has been measure 50+ times”
and the end of the story is the
“Aborting layout after 200 passes. This would probably be an infinite loop”
.

I can see no reason for this to happen as I’m not doing complicated interaction with the layout manager.

Could someone enlighten me what my mistake could be?

Kind regards,
Tim

Edit: I was able to track the problem down a little bit. It looks like it would be caused by mass text which is displayed inside the layout. When resizing the browser this text wraps around often. When I remove the text it’s working properly - but not good enough - because it should be the desicion of the layout’s user what to put in and what not. Is there a workaround for doing this?