Hi surya, You can use disabled=true in your apex tag. 1) <apex:commandButton value="Processing..." status="newStatus" disabled="true"/> >
2) you can also use javascript for disablibg button.
Use a simple Javascript function for disabling buttons. Assign some extra css class to the pageBlock button and disable/enable only these buttons. If one of these buttons is clicked - disable the both. When the action is complete - enable both buttons again:
Hi suryasujansai kotaprolu, Still we need bit more clarity on this ,Assume you have button A and B .On load of page both should visible or one then which one ? Please clarify so that we can give you solution .
Please refer the below code snippet.
Hope this helps you!
Best Regards,
Deepthi
All Answers
You can use disabled=true in your apex tag.
1)
<apex:commandButton value="Processing..." status="newStatus" disabled="true"/> >
2) you can also use javascript for disablibg button.
Use a simple Javascript function for disabling buttons. Assign some extra css class to the pageBlock button and disable/enable only these buttons. If one of these buttons is clicked - disable the both. When the action is complete - enable both buttons again:
<script> function blockReleaseBtns(disable){
var btns = document.getElementsByClassName('saveBtnClass');
for(var i = 0; i < btns.length; i++){
if(disable){
btns[i].disabled = 'disabled';
btns[i].className = 'saveBtnClass btnDisabled';
}
else {
btns[i].disabled = ''; btns[i].className = 'saveBtnClass btn'; }
}
}
</script>
<apex:pageBlock>
<apex:pageBlockButtons>
<apex:commandButton value="Save" reRender="pgBlockMsgs" status="saveStatus" styleClass="saveBtnClass" onclick="blockReleaseBtns(true);" oncomplete="blockReleaseBtns(false);"/>
<apex:actionStatus id="saveStatus">
<apex:facet name="start">
<apex:image value="/img/loading.gif" style="height:20px;"/>
</apex:facet>
</apex:actionStatus>
</apex:pageBlockButtons>
</apex:pageBlock>
Let me knows if its helps you.
Please refer the below code snippet.
Hope this helps you!
Best Regards,
Deepthi
Still we need bit more clarity on this ,Assume you have button A and B .On load of page both should visible or one then which one ? Please clarify so that we can give you solution .
Please refer the below sample code (e.g:Online exam questions).
Visualforce Page
Controller
Hope this helps you!
Best Regards,
Jyothsna