I have a table and data in it. I have delete and edit button in the last column against each row of table. I want to delete any row from the table pressing Delete button against it. button I need the userId in the row on backend . how can I get that userId from each row on backend.
<h:commandButton id="uDeleteId" value="delete" action="#{saveData.deleteUser()}"/[![enter image description here][1]][1]>
If you have
<p:dataTable var="user"
, then your row button can callaction="#{myBean.deleteUser(user.userId)}
, and your deleteUser method signature would bedeleteUser(int userId)
.