在标签页中为vaadin创建面板

时间:2016-04-18 12:57:14

标签: vaadin panel

我已经创建了标签页。问题是我无法滚动页面,所以我只能看到我页面的一半。所以我决定在标签页中创建Panel,但每次插入Panel源代码时都会出错。

public PersonRegistration()
{
    VerticalLayout tab = new VerticalLayout();
    tab.setSizeFull();

    TabSheet tabsheet = new TabSheet();
    tabsheet.addStyleName("center-aligned-tabs");
    addComponent(tabsheet);

    VerticalLayout tab1 = new VerticalLayout();
    tab1.addComponent(new PICConfirm());
    tabsheet.addTab(tab1, "IC Confirmation",null);

    VerticalLayout tab2 = new VerticalLayout();
    tab2.addComponent(new PDemography());
    tabsheet.addTab(tab2, "Demography",null);

    VerticalLayout tab3 = new VerticalLayout();
    tab3.addComponent(new PContact());
    tabsheet.addTab(tab3, "Contact",null);

    Panel panel = new Panel();
    panel.setSizeFull();
    panel.getContent().setSizeUndefined();
    tab.addComponent(panel);
    tab.setExpandRatio(panel, 1);
}

将面板放在标签页内是否可以?

1 个答案:

答案 0 :(得分:0)

尝试简单地调用setSizeFull(); //如果您正在实施View  在那个方法中,看看它是否有效。