Table in full page

Hi,

A pagedtable can be displayed as attached using following code:


public class PagedtableExampleApp extends Application {

    private static final long serialVersionUID = 8672592529682639044L;
    
    @Override
    public void init() {
        VerticalLayout mainLayout = new VerticalLayout();
                
        Window mainWindow = new Window("PagedTable Example", mainLayout);
        VerticalLayout tableLayout = new VerticalLayout();
        setMainWindow(mainWindow);        
        
        tableLayout.addComponent(createButtonGroup());
        
        tableLayout.setSizeUndefined();
        PagedTable table = createTable();
        tableLayout.addComponent(table);
        tableLayout.addComponent(table.createControls());
        table.setHeight("400px");
        mainLayout.addComponent(tableLayout);
        mainLayout.setComponentAlignment(tableLayout, Alignment.MIDDLE_CENTER);
        mainLayout.setMargin(true);
        setTheme("pagedtabletheme");
    }
...
}

My question is how to let table and page navigator take the rest vertical spaces below buttons according to screen resolution.

Thanks,

Watt
11884.png

       
        tableLayout.setSizeFull();
        ...
        PagedTable table = createTable();
        table.setSizeFull();
        tableLayout.addComponent(table);
        tableLayout.setExpandRatio(table, 1);

Except that PagedTable has a bug which prohibits you from using 100% height. It’ll add an row too many to the page and you’ll get scroll bars because of that. Sorry :confused:

setSizeFull() and setExpandRatio(…) do not work. Height calculation for table may need, I guess.

tableLayout and mainLayout also need setHeight(“100%”);