Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 如何使用Primefaces p:dataTable创建此表示例?_Jsf_Primefaces_Foreach_Datatable - Fatal编程技术网

Jsf 如何使用Primefaces p:dataTable创建此表示例?

Jsf 如何使用Primefaces p:dataTable创建此表示例?,jsf,primefaces,foreach,datatable,Jsf,Primefaces,Foreach,Datatable,我在JSF页面中有一个表: <table cellpadding="0" cellspacing="0" border="1" align="center"> <col width="300"/> <col width="150"/> <col width="150" span="3"/> <thead> <tr> <th rowspan="3" >&nbsp;</th&g

我在JSF页面中有一个表:

<table cellpadding="0" cellspacing="0" border="1" align="center">
  <col width="300"/>
  <col width="150"/>
  <col width="150" span="3"/>
 <thead>
  <tr>
    <th rowspan="3" >&nbsp;</th>
    <th rowspan="3" >A</th>
    <th colspan="3" >B</th>
  </tr>
  <tr>
    <th colspan="2">C</th>
    <th rowspan="2">D</th>
  </tr>
  <tr>
    <th>E</th>
    <th>F</th>
  </tr>
 </thead>  
 <tbody> 

 <c:forEach items="${indexbean.regions}" var="r">
   <tr>
     <td colspan="5" >#{r.region}</td>
   </tr>

 <c:forEach items="${indexbean.table_data}" var="s">
  <c:if test="${s.reg eq r.region}"> 
  <tr>
    <td>#{s.rowname}</td>
    <td>#{s.d1}</td>
    <td>#{s.d2}</td>
    <td>#{s.d3}</td>
    <td>#{s.d4}</td>
  </tr>
  </c:if>    
 </c:forEach>

 </c:forEach>

 </tbody>  
</table>

A.
B
C
D
E
F
#{r.区域}
#{s.rowname}
#{s.d1}
#{s.d2}
#{s.d3}
#{s.d4}
这些代码工作正常。但我想使用primefaces p:dataExporter(将此表作为Excel下载),这就是为什么我必须使用p:dataTable创建此表的原因。我在p:dataTable中找不到可以替代2 forEach方法的解决方案。 如何使用Primefaces p:dataTable创建此表?请帮帮我