I have a simple question but I was unable to find the right answer.
I render a datatable which is pretty complex:
<p:dataTable var="label" value="#{labelsManager.labelsList}" rowKey="#{label.cod}" editable="true"
rowsPerPageTemplate="5,10,15,30" paginator="true" paginatorPosition="bottom" rows="30"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rendered="#{not empty labelsManager.labelsList}" scrollable="true" scrollHeight="300" id="labelsList" sortMode="multiple"
selection="#{labelsManager.selectedLabelsForDelete}">
<p:ajax event="rowEdit" listener="#{labelsManager.onRowEdit}" />
...some code...
</dataTable>
and a method
public void onRowEdit(RowEditEvent event) {
... here I want to get the index on the current row...
}
When I want to edit a row I want also to get the index of the current row which will be edited. I searched a lot but I can't see how I can extract the id from the RowEditEvent.
I also tried to sent as an attribute the index of the row but without success. Any ideas? Thanks!