I have created a list of elements with two buttons. The first is "accept", the other is "decline". Whichever button I press, I want it to be removed from my datatable and have my list updated without the removed element. My problem is that my list cannot be updated quickly enough, so I have to wait one second.
<p:commandButton value="Accept" update="mydatatable"
<f:setPropertyActionListener value="#{mymessage}"
target="#{myView.accept}" />
</p:commandButton>
My view. accept
TimeUnit.SECONDS.sleep(1);
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_INFO, "element removed", ""));
What I want to do: execute the update once MyView.accept() is completely finished. I tried to change update by oncomplete/on success but I didn't get any satisfying result. I m looking for something like oncomplete = update="mydatatable"
How could I do that ?