I have a p:datatable
with n records, among these a field with a p:inputText
, when you double click on it, call a p:remoteCommand
that executes a method of managedBean
.
The problem is that in the method I extract the record of where the event originated, but it does not bring me the correct record, it always brings me the last record, please help me.
Deputy code:
<p:column style="width:40px;padding-left:1px;text-align:center;">
<f:facet name="header">
<h:outputText value="Id Orden" />
</f:facet>
<p:remoteCommand name="commandDobleClicOrdenrepId" action="#{ordenTrabajoController.dobleClicOrdenrepId}" partialSubmit="true" />
<h:inputText value="#{item.pk.ordenrepId}" ondblclick="commandDobleClicOrdenrepId();" readonly="true" style="border:0;background-color: #fff"
title="Dar doble clic desea ver la pre-factura actual."/>
</p:column>
ManagedBean
public String dobleClicOrdenrepId(){
SeOrdenRep seOrdenRep = (SeOrdenRep) getListadoOrdenes().getRowData();//AQUI ME DA SIEMPRE EL ULTIMO REGISTRO
return "form.jsf";
}