3
While executing the code below, I have to double click on the button so that the delete action happens I saw many with similar problems, but no effective solution:
<h:form id="TablePais" prependId="false" >
<p:dataTable id="tbPais" var="pais" value="#{beanPais.listagem}" emptyMessage="Não há registros">
<p:column headerText="Ações">
<p:commandButton
id="deleteButton"
icon="ui-icon-trash"
actionListener="#{beanPais.excluir}"
update="tbPais"
ajax="false">
<f:setPropertyActionListener
value="#{pais}"
target="#{beanPais.selectedPais}"
/>
</p:commandButton>
</p:column>
<p:column headerText="Codigo">
<h:outputText value="#{pais.cod}" />
</p:column>
<p:column headerText="Nome:">
<h:outputText value="#{pais.nome}" />
</p:column>
</p:dataTable>
</h:form>
I had the same problem, what I had to do was put a
global="false"
on the button, so it does not let ajaxStatus activate before its activation. In my case, ajaxStatus was updating a field before executing the button.– Gustavo Cinque