3
votes

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?

1

1 Answers

4
votes

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.