I have below code snippet where I have perfectly working select all checkbox. My requirement is to deselect the checkbox after I have successfully updated relevant records in apex class.


<apex:pageblockTable id="XYZ" value="{!wrapList}" var="itr" >
                            <apex:column >
                                <apex:facet name="header">
                                    <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                                <apex:inputCheckbox value="{!itr.selected}" id="inputId"/>

Select All function

 function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");                  
            for(var i=0; i<inputCheckBox.length; i++){          
                    inputCheckBox[i].checked = obj.checked;

I need to deselect obj.checked = false only after DML update done and Success pagemessage shows on Page.

Can someone please help me here?


You would need to bind it to something:

public Boolean isSelectAllChecked { get; set; }


<apex:inputCheckbox value="{!isSelectAllChecked}" onclick="selectAllCheckboxes(this,'inputId')"/>

From there, you can toggle it as you like in Apex code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.