Primefaces data table Row selection and multiple checkbox selection not working

Jerry picture Jerry · Jun 26, 2013 · Viewed 43.4k times · Source

I am using primeface 3.5 where i find the check box to select and unselect or row select work perfectly independently . While I tried to have both the row selection and check box selection ,row selection event is not triggering . Could any one clarify this for me ?

row select is not working thou check all event is working

<p:dataTable id="myBookDTable" var="car" value="#{myBean.pageViews}" paginatorPosition="bottom" paginator="true" rows="30" scrollable="true" scrollHeight="400" scrollRows="30" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" rowsPerPageTemplate="30,50,100"rowKey="#{car.carID}" rowIndexVar="rowIndex" draggableColumns="true" lazy="true">

<p:ajax event="rowSelect" listener="#{myBean.onRowSelect}" update="certainpart"
                                async="true"/>
<p:ajax event="rowSelectCheckbox" listener="#{myBean.rowSelectCheckbox}"/>
<p:ajax event="rowUnselectCheckbox" listener="#{myBean.rowUnselectCheckbox}"/>

<p:ajax event="rowUnselect" listener="#{myBean.rowUnselect}"/>

<p:column  width="30" selectionMode="multiple" style="width:2%" />

</p:datatable>

Answer

Suresh Kumar Pathak picture Suresh Kumar Pathak · Dec 11, 2013

For column header event we have a different header name exist in primeface/jsf: "toggleSelect". You can use like this:

<p:ajax event="toggleSelect" update="@this" process="@this" />