How to force a Table to repaint?

I have a table in a simple customLayout that simulates a collapsible panel. The layout and table work very well overall but I am having a problem with the table not resizing properly. I’m looking for a way to force a repaint or relayout of the table.

As I expand the browser window the table grows to fill the extra space fine. However, when I shrink the window the table gets clipped. If the user hides the table (by collapsing the panel) then show it again the table fixes itself and draws fine.

I have an event that tells me when the window has been resized. All I need is a way to tell Vaadin to repaint the table. I tried setVisible(false) + setVisible(true) but that didn’t do anything. I also tried setSizeUndefined() + setSizeFull() and that didn’t work either. Clearly Vaadin does some optimization and is determining that nothing warrants a repaint on the table so it doesn’t.

Any suggestions?

Not sure this helps, but this sizes the content in a popup window by referring to the containing page’s dimensions. Perhaps you could call this, or a window equivalent using your event? The layout below is an AbsoluteLayout.

        layout.setHeight(Page.getCurrent().getBrowserWindowHeight(), Unit.PIXELS);
        layout.setWidth(Page.getCurrent().getBrowserWindowWidth(), Unit.PIXELS);

Thanks, but the layout already has the correct width. When I inspect the components in the browser I can see clearly that while the layout itself has the proper width, the divs inside stretch outside.

This could be an issue specific to CustomLayouts. Maybe there is something I need to do to make my layout ‘smarter’ or more reactive? Here’s my custom layout definition:

<fieldset class="v-fieldset">    
    <div class="wrapper">
        <legend class="v-fieldset-legend">
            <div location="fieldset-legend">
            </div>
        </legend>    
    </div>
    <div class="v-fieldset-content" location="fieldset-content">
    </div>
</fieldset>