sinclair
sinclair

Reputation: 2861

Primefaces datatable row selection event

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?

Upvotes: 3

Views: 2654

Answers (1)

Ashish Mathew
Ashish Mathew

Reputation: 823

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.

Upvotes: 4

Related Questions