select all checkbox using javascript in visualforce page

Javascript can be used to implement select all checkbox in a table column. Following example uses java script to build such column header.

Visualforce Page

1 comment:

  1. Public with sharing class checkAllcolumnDemocontroller {
    Public List wrapList {get;set;}
    Public checkAllcolumnDemocontroller(){

    Public List getWrapperList(){
    wrapList = New List();
    for(Account acc:[Select name,accountnumber,id,annualrevenue,description from account limit 5]){
    wrapList.add(New wrapperclass(acc,false));
    return wrapList;

    Public class wrapperclass{
    Public account accRec{get;set;}
    Public boolean checkFlag{get;set;}

    Public wrapperclass(account acc,boolean flag){
    accRec = acc;
    checkFlag = flag;