There are Next and Back buttons which help user to view details associated to the next/previous rows.Could you elaborate this? You mean, when the user clicks on the Next and Back buttons, the selected row in the table should move to next and previous row? If yes, you don't need to add any code for it. Just add the ids of the Back and Next buttons as partialTriggers to the table. It should solve your issue.
When user clicks Next or Previous button, then the selection of the row should also gets updated