Primefaces 数据导出器和嵌套数据表 [英] Primefaces dataExporter and nested dataTable

查看:27
本文介绍了Primefaces 数据导出器和嵌套数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在另一个 dataTable 中使用了一个 dataTable.当我尝试使用 dataExporter 导出(以任何格式)时,我得到如下内容:org.primefaces.component.datatable.DataTable@1b675ca"而不是内部 -数据表值.

I'm using a dataTable inside another dataTable. When I try to export (in any format) using the dataExporter i got something like: "org.primefaces.component.datatable.DataTable@1b675ca" instead of the inner-dataTable values.

dataExporter的限制吗?我必须实现扩展 dataExporter 的这个功能?任何替代方案?

Is it a limit of dataExporter? I have to implement this functionality extending dataExporter? Any Alternatives?

推荐答案

这是 dataExporter 的限制,您必须创建自己的导出器才能执行此操作.我认为最好尝试从 Export 类(它是所有自定义导出类的超类)覆盖方法 exportValue.在这里,如果 value 不是 HtmlCommandLinkValueHolder 的实例,则仅使用 toString() ,这就是您看到打印出来的原因.此外,您必须制作动作侦听器,以实例化您的自定义类以进行导出.

This is limitation of dataExporter you have to make your own exporter to do this. I think it is best to try to override method exportValue from Export class (which is superclass of all custom export classes). Here, if value is not instance of HtmlCommandLink or ValueHolder just toString() is used, so that is why you see this is printed. Additionally you will have to make your action listener which will instantiate your custom classes for exporting.

这篇关于Primefaces 数据导出器和嵌套数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆