0

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]>
           
Sajjad Haider
  • 51
  • 1
  • 3

1 Answers1

0

If you have <p:dataTable var="user", then your row button can call action="#{myBean.deleteUser(user.userId)}, and your deleteUser method signature would be deleteUser(int userId).

Tom T
  • 263
  • 1
  • 2
  • 11