Skip to content Skip to sidebar Skip to footer

Primefaces Datatable On Row Select Javascript Callback

I'm trying to call a javascript function whenever a row of a datatable is selected .I can't use ajax because I don't need to send a request and wait for a response from the server

Solution 1:

PrimeFaces Extensions comes to the rescue here.

Use

<pe:javascript event="rowSelect" execute="alert('Datatable rowSelect event called')"/>

If you need the row key for the selected row, use:

<pe:javascript event="rowSelect" execute="console.log(ext.params[0].value)"/>

See also

Post a Comment for "Primefaces Datatable On Row Select Javascript Callback"