Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Nested Tables and their row Height

dmitry shcheglov
9 years ago May 17, 2012 7:37am

After adding in table row, contains another table i cant set table height, and tables looks like at related picture:

After adding i call function, then recalculate layout height:

public void tableHeightOptimizer() {
        Stack<Component> stack = new Stack<Component>();
        stack.push(getWindow().getContent());
        while (!stack.isEmpty()) {
            Component c = stack.pop();
            if (c instanceof ComponentContainer) {
                for (Iterator<Component> i = ((ComponentContainer) c).getComponentIterator(); i.hasNext();) {
                    stack.add(i.next());
                }
            }
            if (c instanceof Table) {
                Table table = (Table) c;
                table.setPageLength(0);
                table.setHeight("100%");
                table.requestRepaint(); 
                table.refreshRowCache();
                for (Object o : table.getItemIds()) {
                    Panel panel = ((Panel) table.getContainerProperty(o, "Перечисление").getValue());
                    stack.add(panel);
                }
            }
        }
    }

but it works not correctly. if i add an item in top level table, all others tables (in rows) redraw correctly.

Can anyone help me?

Kimball Robinson
9 years ago Nov 30, 2012 10:02pm