You need to sign in to do that
Don't have an account?
Enrico dev
Action status to make inactive command button
Following is my VF page:
Controller:
In order to avoid multiple records created after multiple clicks on "Save" command button, i ´ve implemented above logic.
It seems to work but in production environment i've found record duplicates created by users. Duplicated records have only 3 seconds of difference looking at records´creation date.
Is this issue related to same page delay or have i some error in the vf page?
Will be better to make inactive the button using javascript after first click?
Thanks in advantage for any advice.
<apex:page controller="ctrlInactivetest"> <apex:form id="form"> <apex:pageBlock id="block"> <apex:pageBlockButtons id="buttons"> <apex:actionStatus id="mySaveStatus1"> <apex:facet name="stop"> <apex:commandButton value="Save" action="{!save}" rerender="pm" status="mySaveStatus1"/> </apex:facet> <apex:facet name="start"> <apex:outputPanel > <apex:image value="/img/loading32.gif" style="height: 15px;"/> <apex:commandButton value="Processing..." status="mySaveStatus1" disabled="true"/> </apex:outputPanel> </apex:facet> </apex:actionStatus> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
Controller:
public class ctrlInactivetest { public ctrlInactivetest(){ } public PageReference Save(){ system.debug('RecordCreated'); return null; } }
In order to avoid multiple records created after multiple clicks on "Save" command button, i ´ve implemented above logic.
It seems to work but in production environment i've found record duplicates created by users. Duplicated records have only 3 seconds of difference looking at records´creation date.
Is this issue related to same page delay or have i some error in the vf page?
Will be better to make inactive the button using javascript after first click?
Thanks in advantage for any advice.
Karanraj
Check this link to disable a button after a first click http://salesforce.stackexchange.com/questions/7729/disable-commandbutton-after-first-click-to-prevent-double-submission