aspose file tools*
The moose likes JSF and the fly likes SelectAll checkbox in header column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "SelectAll checkbox in header column" Watch "SelectAll checkbox in header column" New topic
Author

SelectAll checkbox in header column

Charles Ben
Greenhorn

Joined: Jun 02, 2009
Posts: 8

Im using datatable and i got a requirement to have a checkbox in the header section along with the label "Action"
on select it should select all the checkboxes under that column and on uncheck it should
uncheck all the selected checkboxes below ..

Could someone suggest the approach to be taken for this scenario.
is it possible to add another checkbox alongside header label under same facet tag?
Rajneesh Kumar Rajput
Ranch Hand

Joined: Feb 25, 2009
Posts: 39
Yes, it is perfectly valid you can use panelGrid inside the facet and have the header checkbox along with the header label.



simply you can java script to select and un select all the other rows checkboxes.
Charles Ben
Greenhorn

Joined: Jun 02, 2009
Posts: 8
Thanks Rajneesh

I made the header column as Command link and called the action to do the select/deselect functionality in backing bean class.
Javascript was slowing down when the data was more in datatable and so went wth java implementation.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SelectAll checkbox in header column
 
Similar Threads
How do you implement Tomahawk tree control with a CheckBox?
How to handle checkbox in jsf
JSF 1.2 Inner Datatable selectBooleanCheckBox - Selected options wrongly reflected in the Bean
Which Package to Import to Use FacesContext's getRequestMap()?
empty table column header on a dataTable when trying to fill it dynamically...