Question: how to get selected row index in jsf datatable?
Answer: What you can do is to use the [getRowData()][1] method on the Java bean to directly get the object located on the line that hosts the button on which the user clicked. In addition, do not forget to change the signature of editBook() method, by setting a javax. faces.