Activity Forums Salesforce® Discussions Add 'Select All' functionality in pageBlockTable

  • Add 'Select All' functionality in pageBlockTable

    Posted by Shubham on April 26, 2016 at 10:05 am

    How can i add 'Select All' 'Deselect All' functionality to pageblocktable which is iterating a wrapper list (checkbox and list of products). Like when inputcheckbox with id="mainbox" is checked all the inputcheckbox with id = "checkbox" should get selected.

    <apex:pageBlockTable value="{!wrapProductList}" var="prd" title="Products" id="prdtList">
    <apex:column >
    <apex:facet name="header"><apex:inputCheckbox id="mainBox"/></apex:facet>
    <apex:inputCheckbox value="{!prd.isSelected}" id="checkBox"/>
    </apex:column>
    <apex:column >
    <apex:facet name="header">Product Name</apex:facet>
    <apex:outputText value="{!prd.prdt.Name}"/>
    </apex:column>
    <apex:column >
    <apex:facet name="header">Product code</apex:facet>
    <apex:outputText value="{!prd.prdt.ProductCode}"/>
    </apex:column>
    <apex:column >
    <apex:facet name="header">Sales Price</apex:facet>
    <apex:outputText value="{!prd.prdt.UnitPrice}"/>
    </apex:column>
    </apex:pageBlockTable>

    • This discussion was modified 8 years ago by  Shubham.
    Ravi replied 8 years ago 2 Members · 1 Reply
  • 1 Reply

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos