注:我從字面上纔開始在上週調查V7,所以我的迴應謹慎...
這兩個問題從事實幹FormLayout從不提供頁眉和頁腳--Form類沒有提供。
我會建議創建您自己的具有標題佈局,FormLayout和頁腳佈局例如Form的等價物。 (沒試過使用,可能需要使用一個網格佈局,而不是爲VerticalLayout的mainLaout)
public class FormComponent extends CustomComponent {
private Layout mainLayout;
protected Layout header;
protected Layout central;
protected Layout footer;
public FormComponent() {
init(new HorizontalLayout(), new FormLayout(), new HorizontalLayout());
}
protected void init(Layout header, Layout central, Layout footer) {
this.footer = footer;
this.header = header;
this.central = central;
mainLayout = new VerticalLayout();
mainLayout.addComponent(header);
mainLayout.addComponent(central);
mainLayout.addComponent(footer);
setCompositionRoot(mainLayout);
setSizeUndefined();
}
public Layout getHeader() {
return header;
}
public Layout getCentral() {
return central;
}
public Layout getFooter() {
return footer;
}
}
謝謝。我已經這樣教了一些東西,但希望有一個內置的解決方案。如果實際上沒有任何東西,我會再等一等,並接受你的回答。 – raffael 2013-04-09 10:16:17