Last active
December 15, 2019 03:08
-
-
Save sfdcale/20da03ec891e668a8b520da43c5570eb to your computer and use it in GitHub Desktop.
This is my approach of how to disable commandButton until first click is processed and re-enable after first click results are returned from controller to page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <apex:page> | |
| <script> | |
| var defaultEventListenerForSubmitBtn; | |
| </script> | |
| <apex:outputPanel id="op-panel"> | |
| </apex:outputPanel> | |
| <apex:commandButton value="Submit" | |
| action="{!controllerActionMethod}" | |
| rerender="op-panel" | |
| onclick="this.value='Processing..';defaultEventListenerForSubmitBtn = this.onclick;this.onclick=function(){this.value='Processing..';return false;}" | |
| oncomplete="this.onclick = defaultEventListenerForSubmitBtn;this.value='Submit';"/> | |
| </apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment