i have a problem with my datatable, after i sort the table by any value and klick on my commandlink at the row, the actionlistener uses the value that was in that row before sorting.
for example: if i have item with ID 36 at first row in table and after sorting item ID 1 at first row. After submit i have item with ID 36 at bean.current.
Code: Select all
...
<p:dataTable rendered="#{bean.rowCount gt 0}" id="table"
value="#{bean.list2}" var="r" rows="#{userBean.tableRows}"
paginator="true" paginatorAlwaysVisible="false"
paginatorTemplate="{CurrentPageReport} | {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} | {RowsPerPageDropdown}"
rowsPerPageTemplate="10,15,20,50,100"
style="width: 100%;" styleClass="dt">
<p:column style="width:10px">
<p:rowToggler />
</p:column>
<p:column style="width:20px" sortBy="#{r.id}" parser="number">
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<h:outputText value="#{r.id}" />
</p:column>
<ui:insert name="columns" />
<p:column style="width:20px">
<p:commandLink action="#{bean.read}" ajax="false">
<h:graphicImage value="/images/edit.gif" />
<f:setPropertyActionListener value="#{r}"
target="#{bean.current}" />
</p:commandLink>
</p:column>
...