I am using Primefaces p:datatable with p:rowExpansion. My aim was to show row details using following xhtml.
<p:dataTable
value="#{bilisimArizaBean.kullaniciBilisimArizalariListesi}"
var="ariza">
<p:column style="width:4%">
<p:rowToggler />
</p:column>
<p:column headerText="Arıza no">
#{ariza.bilisimArizaId}
</p:column>
<p:column headerText="">
#{ariza.bilisimArizaTuru.bilisimArizaTuru}
</p:column>
<p:column>
#{ariza.cihazMarkasi} #{ariza.cihazModeli} #{ariza.cihazSeriNo}
</p:column>
<p:column>
#{ariza.arizaAciklama}
</p:column>
<p:rowExpansion>
<div>
<p:panelGrid id="display" columns="4" cellpadding="4"
style="border:1px;border-color:red;"
styleClass=" ui-widget-content grid">
<ui:repeat var="ticket" value="#{ariza.bilisimArizaTicket}">
<h:outputText value="Gelişme No" />
<h:outputText id="gelisme" value="#{ticket.ticketAciklama}" />
<h:outputText value="Durum:" />
<h:outputText id="durum" value="#{ticket.arizaDurum.durumAdi}" />
<br></br>
</ui:repeat>
</p:panelGrid>
</div>
</p:rowExpansion>
</p:dataTable>
I expected it will create table rows with columns inside p:rowExpansion. But it,ui:repeat produces a table with rows with only one column. And spans inside this column. That is
<table>
<tr>
<td><span>data</span><span>data</span><span>data</span></td>
</tr>
<tr>
<td><span>data</span><span>data</span><span>data</span></td>
</tr>
.
.
.
</table>
I expected and want the following
<table>
<tr>
<td>data</td> <td>data</td> <td>data</td>
</tr>
<tr>
<td>data</td> <td>data</td> <td>data</td>
</tr>
.
.
.
</table>
Why spans instead of columns in this case? And how can get columns instead of spans in one columns?
Regards
In your particular construct, the
<ui:repeat>inside<p:panelGrid>doesn’t generate multiple JSF components which generates its HTML each only once. Instead, it reuses the same JSF components to generate its HTML output multiple times on every iteration.This is not right. You need a
<h:dataTable>or<p:dataTable>here instead of<p:panelGrid><ui:repeat>.E.g.
Those spans are unrelated, they are just coming from
<h:outputText>.