Programmatically force layout from the server

Is there any ways to force layout from the server, not from client ?

The problem that I have a window with several panels, vertically aligned. Each panel is a custom layout based component with variable height (depends on current contents on the panel):


P1
P2
P3
P4
P5

During the user interaction, window shows and hides particular panels according to current process state (by using setVisible method). The problem is when panels P1 to P3 are hidden and P4 displayed, and then reverted back (P1 to P3 are visible, P4 - not) - there are some huge gaps appears between P1,P2 and P3 components - this seems to be because P4 component had a large height. Page reload or forceLayout from debug console fixes this. Can I trigger the forceLayout from the client right after I update the panels visibility status ?

P.S. It was OK in 5.2, but it seems appeared in 5.3

Hi!

This sounds like a layout bug to me (which we have had a lot recently due large changes done for 5.3). Forcing layout/repaint should not be necessary for developers. We should fix it asap. Can you provide a ticket and a reduced test case?

To totally repaint child tree from server side (so that the old client side implementation gets truncated), you’d need to move child tree to different parent component.

cheers,
matti

Thanks, Matti,
I created a http://dev.itmill.com/ticket/2670

Also, I’ll try to make and attach a smaller testcase for this today.

It looks like this is custom theme/css issue, not a toolkit bug. In default/clean theme it works fine.

I also need to programatically force the layout the server. I’m using liferay 6.0.3 and building a portlet using Vaadin 6.3.4. I have a simple application that is comprised of a table. The problem is that when I move the portlet window to another side of the screen (the screen is arranged with 2 columns; one side takes 30% of the screen, the other takes 70%) the portlet window is resized to fit in the smaller real estate but the UI components that Vaadin renders are not “redrawn”. I’d like for Vaadin to recalculate how much screen estate it has to work with and redraw the components. I’ve found that if click the ‘Force Layout’ from the Vaadin debug window then the UI components are redrawn correctly sized. (I’ve also found that this can be called via javascript using via vaadin.forceLayout() )
I’ve inspected the html elements and found that when Vaadin initially renders them it sets absolute sizes on them (i.e., 300px, etc) and that upon calling force layout it will redraw them with smaller sizes if it has less real estate in which to draw them.
So my question is, is there a way to force the layout to be redrawn from the server or to get Vaadin to use relative sizing on components?

table = new com.vaadin.ui.Table(“Document Information”);
table.setWidth(“100%”);
table.setSelectable(true);
table.addContainerProperty(“Date”, String.class, null);
table.addContainerProperty(“Title”, String.class, null);
table.addContainerProperty(“Type”, String.class, null);
table.addContainerProperty(“Author”, String.class, null);
table.setImmediate(true);

Window.executeJavaScript(“vaadin.forceLayout()”); is one way of achieving it, should work.

Even in Vaadin 7.5 this works.