用Java代码从PrimeFaces Datalist中提取项目

时间:2013-10-09 08:12:26

标签: jsf primefaces datalist

如何从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);
        }
    }
}

0 个答案:

没有答案