default behavior for primefaces select all check box

UI Components for JSF
Post Reply
eWMS
Posts: 90
Joined: 22 Jun 2011, 11:20

15 Jul 2011, 08:55

Hi,

the default behavior for primefaces select all check box (with paginator) when clicked is that, it enables all the select box across all pages.

<input type="checkbox" onclick="defaultTable.toggleCheckAll(this)" name="defaultTable:j_id131_checkAll">

the onclick="toggleCheckAll(this), will enable all the check boxes across all pages.

so when the method associated to the datatable "selection" property is called, we get all the rows.


In case of lazy data model, the same records are repeated,

In case of a simple data model, all records are passed to the method.


I think (going by other application having same functionality), select all check box should enables records only in the current page.....
should not enable all records (form other pages).


Can you please help me here.

Thanks in advance!

Environment:
Primefaces 3.0.M2
JSF v2.1.1 with MyFaces Implementation
SWF v2.3.0.RELEASE

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

15 Jul 2011, 09:14

Multiple selection is not supported in lazy loading. SelectAll checkbox should select all records in table.

eWMS
Posts: 90
Joined: 22 Jun 2011, 11:20

15 Jul 2011, 09:44

Thanks for your quick clarification :)

What option do we have....
If we need select all check box should enable records only in the current page.....should not enable all records (form other pages) in lazy and simple data model.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

15 Jul 2011, 09:58

I think you need to implement it manually, by placing a checkbox on column header and column cells, with a jQuery one liner you can select all the checkboxes.

Here is sample impl that's using a Map<String,Boolean>;

http://java.dzone.com/articles/binding- ... Java+Zone)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests