I am developing a Primefaces 6.2 application in which I use the datatable component in edit mode.
<p:remoteCommand name="refrescarTabla"
actionListener="#{bean.dlgEditar.refrescarTabla}"
update="pgTabla"/>
<h:panelGroup id="pgTabla">
<p:dataTable id="tabla" var="reg"
value="#{bean.dlgEditar.datos}" editable="true" editMode="cell"
widgetVar="cellDato">
<p:ajax event="cellEdit"
listener="#{bean.dlgEditar.alEditarRegistro}"
oncomplete="refrescarTabla()"/>
...
</p:datatable>
</h:panelGroup>
When I edit a cell in the table for the first time, the component works correctly.
There are columns that depend on others, so when I make a change in a cell, I must refresh the table (for this I use the remoteCommand component) to reflect the changes. From this moment the problem appears, and if I try to edit a cell again, the cell loses focus in less than a second, so I can not edit the value.
I have seen some recommendations like this post from BalusC in SO: link , however I have not been able to solve the problem.
EDITION 1
I just created an example that reproduces the problem: link .
The example shows in table form the ingredients of a recipe. The fields that it shows are name, quantity and percentage. When editing a field (quantity is editable), the remotecommand is launched to update the table.
To reproduce the problem, we simply try to edit the amount of an ingredient, and then click on the amount of another ingredient (to edit it too). We will see the effect of instantaneous loss of focus.