How to combine different selection modes in DataTable?

UI Components for JSF
Post Reply
Echuy
Posts: 8
Joined: 07 Apr 2015, 13:32

25 Aug 2015, 17:13

I have a single-selection mode DataTable with an AJAX action on "rowSelect".

Code: Select all

<p:ajax event="rowSelect" listener="#{databean.onRowSelect}"/>
It works fine, but now i need to add some group operations in my project. For this task, I have to add new a column with checkboxes.

Code: Select all

<p:column selectionMode="multiple" style="width:16px;text-align:center"/>
But I see no solution how to make my Table work with two different selection modes at the same time. If I add this column and left selectionMode="single", onClick event works fine, but checkbox will only display what row had been selected. If I delete selectionMode="single", checkboxes and group operations will work well, but onClick event will not be executed (because it will select a single row).

How to make both selection modes work at the same time?

P.S. There are not the same operations for "single" and "multiple" actions, they have different actionListeners.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests