I am using PrimeFaces 6.0 in my project to dataTable
inside subTable
has to be used. I need how to get row index inside the subTable
<h:form>
<p:dataTable var="team" value="#{dtSubTableView.teams}" rowIndexVar="teamIndexVar">
<f:facet name="header">
NBA Teams
</f:facet>
<p:columnGroup type="header">
<p:row>
<p:column rowspan="2" headerText="Team" />
<p:column colspan="2" headerText="Stats" />
</p:row>
<p:row>
<p:column headerText="Wins" />
<p:column headerText="Losses" />
</p:row>
</p:columnGroup>
<p:subTable var="stats" value="#{team.stats}">
<f:facet name="header">
<h:outputText value="#{team.name}" />
</f:facet>
<p:column>
<h:outputText value="#{stats.season}" />
</p:column>
<p:column>
<h:outputText value="#{stats.win}" />
</p:column>
<p:column>
<p:commandButton id="editButton" value="Edit" />
</p:column>
</p:subTable>
</p:dataTable>
</h:form>
I need when I press command button to pass current index inside subTable
.