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>
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" />
In your datatable
tag,
Use this
<p:ajax event="rowSelectCheckbox" update="someComponent" />
<p:ajax event="rowUnselectCheckbox" update="someComponent" />
<p:ajax event="rowSelect" update="someComponent" />
<p:ajax event="rowUnselect" update="someCompoent" />
<p:column selectionMode="multiple" style="width:4%" />
you need to fire these four ajax events and make sure you make the column selectionMode
as multiple
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With