1
votes

PrimeFaces 4.0, Glassfish 3.1.2, Mojarra 2.1.6

I created a p:dataTable and a contextMenu references to the dataTable. The first column of the dataTable contains p:commandLink. The problem is, if I click on the commandLink with right mouse button, the row is not selected. How can I select the actual row? I tried it with Javascript, but no results.

I think, I should use the PrimeFaces Javascript API to do this. But how can I determine, which row did I click on?

Thanks.

1

1 Answers

0
votes

I solved it with the following Javascript code.

dataTbl.unselectAllRows();dataTbl.selectRow(jQuery(this).closest('tr').index());

I put it into the mouseDown event because I need to select the row on right click too.