如何从Primefaces DataList UIComponent中提取项目(即连接它们的值)?我正在尝试编写自定义导出器,这是我的代码:
import org.primefaces.component.datalist.DataList;
import org.primefaces.component.export.ExcelExporter;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
public class CustomXLSExporter extends ExcelExporter {
@Override
protected String exportValue(FacesContext context, UIComponent component) {
if (component instanceof DataList) {
DataList dataList = (DataList) component;
return "values from data-list here";
} else {
return super.exportValue(context, component);
}
}
}