I'm trying to implement an a data table that includes sub tables, each header have a command link that opens a dialog and sets a property in the backing bean through set property action listener. the problem is that the set is working only for the first item in the table, this is also true for action and actiobListner. this has been tested Primefaces 4 on glassfish 4
Here is the code for the table:
<p:dataTable id="resTable" var="res" value="#{reportsBean.getResources(reportType)}"
paginator="true" rows="100"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="3,25,50,100,250,500"
filteredValue="#{reportsBean.filteredResource}" emptyMessage="No Items Entered"
>
<f:facet name="header">
#{reportType} Data
</f:facet>
<p:columnGroup type="header">
<p:row>
<p:column rowspan="2" headerText="Item" />
<p:column colspan="5" headerText="Item Data" />
</p:row>
<p:row>
<p:column headerText="Rate" />
<p:column headerText="Loss rate" />
<p:column headerText="Quantity" />
<p:column headerText="Price" />
<p:column headerText="Notes" />
</p:row>
</p:columnGroup>
<p:subTable var="stats" value="#{res.tenderItemsDataList}" id="subTable1" >
<f:facet name="header">
#{res.title}
<p:commandLink update="@(.editPanel)" id="detail" type="button" oncomplete="PF('viewer').show()" title="View Detail" process="@(.subTable1)" onclick="load()">
<h:outputText styleClass="ui-icon ui-icon-search" style="margin:0 auto;" />
<f:setPropertyActionListener value="#{res}"
target="#{reportsBean.selectedResource}" />
</p:commandLink>
</f:facet>
<p:column>
#{stats.title}
</p:column>
<p:column>
#{stats.rate}
</p:column>
<p:column>
#{stats.lossRate}
</p:column>
<p:column>
#{stats.quantity}
</p:column>
<p:column>
#{stats.price}
</p:column>
<p:column>
#{stats.notes}
</p:column>
</p:subTable>
</p:dataTable>