我试图在 JSf 中构建一个 Java 类,在这个简单的示例中使用 UiDataview 向 XPage 添加一个带有寻呼机的视图,但我的问题是添加到结果中的寻呼机女巫永远不会显示在我的 Xpage 中。有人知道我该怎么做吗?
public class MainLibcontrol extends UIComponentBase implements FacesComponent {
private static final String RENDERER_TYPE = "de.my.MainLibcontrol";
private static final String COMPONENT_FAMILY = "de.my";
public MainLibcontrol() {
setRendererType(RENDERER_TYPE);
}
@Override
public String getFamily() {
return COMPONENT_FAMILY;
}
@SuppressWarnings("unchecked")
public void initBeforeContents(FacesContext arg0) throws FacesException {
try {
UIDataView viewtable = new UIDataView();
viewtable.setColumnTitles(true);
CategoryColumn categoryColumn = new CategoryColumn();
categoryColumn.setComponent(viewtable);
categoryColumn.setColumnName("form");
categoryColumn.setColumnTitle("form");
categoryColumn.setContentType("text");
viewtable.addCategoryColumn(categoryColumn);
DominoViewData data = new DominoViewData();
data.setComponent(viewtable);
data.setViewName("142342");
data.setVar("view2");
viewtable.setData(data);
viewtable.setId("dataView1");
viewtable.setRows(3);
SummaryColumn summaryColumn = new SummaryColumn();
summaryColumn.setComponent(viewtable);
summaryColumn.setColumnName("5");
summaryColumn.setColumnTitle("5");
viewtable.setSummaryColumn(summaryColumn);
XspPager pager = new XspPager();
pager.setPartialRefresh(true);
pager.setLayout("Previous Group Next");
pager.setId("pager1");
viewtable.getChildren().add(pager);
this.getChildren().add(viewtable);
} catch (Exception e) {
e.printStackTrace();
}
}
public void buildContents(FacesContext arg0, FacesComponentBuilder arg1) throws FacesException {
.....
}
public void initAfterContents(FacesContext arg0) throws FacesException {
....
}
}