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