Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
GridLayoutConnector has been layouted 3 times
I have a simple page with a VerticalLayout and inside it, among other components there is a GridLayout:
... myVerticalLayout.addComponent(myGridLayout); myGridLayout.addComponent(c1); myGridLayout.addComponent(c2); myGridLayout.addComponent(c3); myGridLayout.addComponent(c4); myGridLayout.addComponent(c5); ... setCompositionRoot(myVerticalLayout); ...
And when that page loads, in Chrome or Firefox console I get this:
dev.widgetset.tpotWidgetset-0.js:6527 com.vaadin.client.LayoutManager SEVERE: GridLayoutConnector (17) has been layouted 3 times
I'm using Vaadin 7.6.6
Do you know the cause or what does the number (17) mean?
The warning message comes from Vaadin LayoutManager, which does the layouting of components inside Vaadin-controlled Layouts (like VerticalLayout or Gridlayout, but not CSSLayout). It works, roughly speaking, so that it runs an infinite loop where it applies sizes to the top level it controls, which then cascades changes down the component hierarchy for each child widget. If everything goes smoothly, it can exit the loop, but it can be that as a result of the first round, there's a need to keep doing the layouting loop again to fit all widgets correctly inside their parents.
In your case, the GridLayout has been layouted 3 times, but eventually the layouting loop has terminated successfully. Since 3 is the smallest number where you get that message, I wouldn't worry about it too much. You can use the "Check layouts for potential problems" in the debug window to analyze your UI just in case. If you'd get much larger numbers than that, I would suspect that some of the widgets inside the grid might be handling resize events incorrectly and thus the layouting loop wouldn't be able to find a satisfactory result.
The number 17 is the connector id of the GridLayoutConnector in your UI, which might be helpful if you're trying to pinpoint which layout exactly is causing problems.
Hope this helps,
Thanks for the detailed answer,
I used "Check layouts for potential problems" and it said "Layouts analyzed, no top level problems", so I think I'll leave it like that.