On a page with a datatable displaying all users, each row includes "edit" and "delete" buttons. The issue arises when trying to delete a user by clicking on the "delete" button. Upon clicking the button, a confirmation dialog is displayed using PrimeFaces components. If the user confirms by clicking "ok", a method is executed to delete the user from the database.
<p:column>
<p:commandButton actionListener="#{utilisateursController.supprimerUser()}" value="Supprimer" onclick="confirmation.show()" type="button" >
<f:setPropertyActionListener id="jesusi" value="#{car}" target="#{utilisateursController.u1}" />
</p:commandButton>
</p:column>
It is necessary for the user to be assigned to utilisateursController.u1
in order to delete them. However, when clicking the button, the following code:
<f:setPropertyActionListener id="jesusi" value="#{car}" target="#{utilisateursController.u1}" />
does not get executed
As a result, utilisateursController.u1
remains null.
If you have any suggestions or ideas, please share. Thank you in advance.