New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Sunday, 5 August 2012

Disable command buttons on click in visualforce

Clicking on a commandButton multiple times in a row, results in action being fired multiple times
To avoid above problem use below code

<apex:page >
 <apex:form >
 <apex:actionStatus id="mySaveStatus1">
<apex:facet name="stop">
<apex:commandButton value="Save Mappings" action="{!save}" rerender="dummy" status="mySaveStatus1"/>
</apex:facet>
<apex:facet name="start">
<apex:commandButton value="Processing..." status="mySaveStatus1" disabled="true"/>
</apex:facet>
</apex:actionStatus>
</apex:form>
</apex:page>

No comments:

Post a Comment

Labels