Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces datatable row selection event

Tags:

jsf

primefaces

I'm trying to use Primefaces datatable with radiobutton-selection but the rowSelect event is not fired.

If I set selectionMode="single" in the datatable the event is fired, but the whole row is clickable.

<p:dataTable value="#{bean.items}" editable="true" var="item"  selection="#{bean.selectedItem}"  rowKey="#{item.id}">
    <p:ajax event="rowSelect" listener="#{bean.doSomething}" update=":form:msgs" />

    <p:column selectionMode="single" />
    ....

Is it possible to trigger the rowSelect-event when using radiobutton-selection?

like image 305
sinclair Avatar asked Aug 11 '26 21:08

sinclair


1 Answers

Use the rowSelectRadio event

<p:ajax event="rowSelectRadio" listener="#{bean.doSomething}" update=":form:msgs" />

Check the PrimeFaces user guide. It lists all the ajax behaviour events for each component.

like image 67
Ashish Mathew Avatar answered Aug 14 '26 11:08

Ashish Mathew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!