Need to capture the rowSelect event of a dataTable having checkbox based row selection. The code is as follows:
<p:ajax event="rowSelect" listener="#{articleBean.onRowSelect}"
oncomplete="articleBean.onSelection" />
<p:ajax event="rowUnselect" listener="#{articleBean.onRowUnselect}"
oncomplete="articleBean.onSelection" />
<p:column id="name" headerText="Select" selectionMode="multiple"
style="width:18px" />
I'm unable to understand the behavior. When I click checkbox for the first time, the method "onRowSelect" is getting called. When I unselect, "onRowUnselect" is not getting called. And also, the "onRowSelect" method is called just once for the grid, as in, if I click any other checkbox, the event is not getting triggered. Am I missing out anything? Not able to understand this behavior.
As you are using dataTable with checkbox based row selection then you should replace:
<p:ajax event="rowSelect"
<p:ajax event="rowUnselect"
With the following:
<p:ajax event="rowSelectCheckbox"
<p:ajax event="rowUnselectCheckbox"
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