+ Start a Discussion
prady-cmprady-cm 

Can we have a checkbox on apex:column header?

Hi,

 

I am having a search results in a apex:PageblockTable. I aslo need a way to have checkbox on the header to allow a select all and delete the records. Is there a way i can do that using PageblockTable?

 

I want to have the UI as much as possible like the standard UI . With the normal table its quite difficult to achieve this

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
ShaTShaT

Hi ,

 

You can add a inputcheck box in header

 

eg-:

 

<apex:pageBlockTable value="{!listContact}" var="w" id="cList" >
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox " id="chkbox"/>
</apex:facet>

</apex:column>

</apex:pageBlockTable>

 

Thanks

Shailu

All Answers

ShaTShaT

Hi ,

 

You can add a inputcheck box in header

 

eg-:

 

<apex:pageBlockTable value="{!listContact}" var="w" id="cList" >
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox " id="chkbox"/>
</apex:facet>

</apex:column>

</apex:pageBlockTable>

 

Thanks

Shailu

This was selected as the best answer
kiranmutturukiranmutturu

ya u can do that.. u can implement this by using cliet side script....by taking all the ids of the result and when ever u are selecting the main check box  u need to get all the list of checkbox ids and need to check through script....

prady-cmprady-cm

Thanks Shailu and Kiran..

 

Shailu your code was what i was looking for.

Kiran: i ended up using a controller method to select all the records