我有2个数据表:
<p:dataTable id="tbl1" var="prop1" value="#{bean.prop1}" rendered="#{bean.listP1.size() != 0}">
// ...
</p:dataTable>
和
<p:dataTable id="tbl2" var="prop2" value="#{bean.prop2}" rendered="#{bean.listP2.size() != 0}">
// ...
</p:dataTable>
在XHTML页面上,经过一些操作,根据listP1
和listP2
的大小,我都得到了正确的结果。
我的问题是单击导出按钮]后>
<h:commandLink> <p:graphicImage value="/resources/icons/download.png" style="width : 35px; height:35px"/> <pe:exporter type="pdf" target="tbl1, tbl2" fileName="SurveyResults"/> </h:commandLink>
我得到了错误的结果:我得到了两个表而不是一个表,因为其中一个表是
size = 0
您对解决这个问题有任何想法吗?
我有2个dataTables:
pe:exporter
不在乎是否提供了您提供的数据表。不过,您可以使用EL为target
属性创建动态值,例如: