Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deselecting a table row in PrimeFaces

I have a table like this:

<p:dataTable id="table" selectionMode="single">  

    ...

    <p:ajax event="rowSelect" listener="#{myBean.onRowSelect}" update="someStuff"/>
    <p:ajax event="rowUnselect" listener="#{myBean.onRowUnselect}" update="otherStuff"/>

</p:dataTable>

Does anyone know how to trigger the rowUnselect event on the UI ?

Another thing, what are the possible values of the selectionMode attribute ? They don't seem to be in the documentation.

Thanks,

like image 903
Simeon Avatar asked Nov 02 '25 02:11

Simeon


1 Answers

To trigger rowUnselect, once a row is selected, hold control key and click on the row again. That way the row gets unselected, and the ajax event is executed.

Possibles values for selectionMode attribute are "single" and "multiple".

like image 175
damian Avatar answered Nov 03 '25 16:11

damian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!