java - Primefaces 3.4 dataexporter 不导出值 p :cellEditor

标签 java jsf primefaces

我正在使用 Primefaces 3.4 并尝试使用单元内编辑导出数据表。它似乎不起作用。

我做了以下事情:

修改 org.primefaces.component.export.Exporter 第 143 行并添加:

else if (component instanceof CellEditor) { // Handle in-cell editable datatables
    return exportValue(context, ((CellEditor) component).getFacet("output"));
}

这会导致在顶部多出一行,并在包含数据的实际单元格右侧多出一列。使用 Excel 文件没关系,因为它们不是“可见的”,但 PDF 看起来很糟糕。

  1. 有没有办法让 PF 3.4 在不更改源代码的情况下支持它?
  2. 如果对上述问题的回答是否定的,我能否生成 PDF 而无需额外的行/列?

最佳答案

Is there a way to make PF 3.4 support this without changing the source code?

没有。您必须提供自定义的 Exporter 实现/覆盖。我已经将其报告为 issue 4013几个月前。它不仅提到了 CellEditor,还提到了 HtmlGraphicImage(我们使用图像来显示 boolean 状态,我们希望以 PDF 格式显示其 alt/XML/XLS/CSV 报告)。

您所能做的就是为它投票,这样它就有希望得到更多的关注,或者通过在 PF forum 上重新提问它。 .


If the answer to the above is negative, can I make the PDF get generated without the additional row/column?

您可以通过设置 exportable="false" 属性隐藏列的导出。

<p:column exportable="false">

关于java - Primefaces 3.4 dataexporter 不导出值 p :cellEditor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12705319/

相关文章:

java - 无法从其他方法访问 TextView

Java将二维数组的行按升序排序,列按降序排序

java - 真的需要浅拷贝吗?

java - 如何在java swing中弹出错误来检查酒店入住日期是否应该早于退房日期?

ajax - 地址 ui 中的 JSF 组件 :repeat

java - 如何将参数传递给 JSF 2.0 页面上的 javascript 函数

jsf - 如何在 p :tabView component 中动态添加和删除选项卡

java - 为什么我的h :message for a specific id not displaying correctly in my dynamic form?更多在描述

java - eclipse : adding JSF 2 facet results in NullpointerException

java - 从 tomcat 取消部署 war 时图像丢失