You need to sign in to do that
Don't have an account?
JoshTonks
help with a commandbutton and to show it is saving
I have a command button that creates a record and when it is saving it freezes for a few seconds whilst it is executing. I cannot figure a way to display that it is saving so people dont just reclicking the button. Ive seen people display a gif whilst saving but im unable to find a way to replicate this function or even display in text that it is saving
<apex:form style="margin: 10px; color:#322c4f"> <span style="font-size:1.25em">Request callback</span> <table style="color:#322c4f"> <tr> <td colspan="2" style="color:#322c4f"> User: </td> <td style="color:#322c4f"> {!$User.FirstName} {!$User.LastName} </td> </tr> <tr> <td colspan="2" style="color:#322c4f"> Date & Time: </td> <td style="color:#322c4f"> <apex:outputText value="{0,date,dd/MM/yyyy HH:mm}"><apex:param value="{!NOW()}" /></apex:outputText> </td> </tr> <tr> </tr> <tr> <td colspan="2" style="color:#322c4f"> Interested In: </td> <td style="color:#322c4f"> DashCams </td> </tr> </table> <br/> <span style="padding-left: 1px">Contact: <apex:selectList multiselect="false" value="{!selectedContact}" size="1"> <apex:selectOptions value="{!contacts}"> </apex:selectOptions> </apex:selectList><br/> Notes:<br/> <apex:inputTextarea value="{!Notes}" rows="3" style="width:50%; border: 1px solid #322c4f; color: #322c4f; margin-left:2px" /></span> <apex:commandButton styleClass="logger" value="Save" action="{!save}" style="width:25%;float: right; margin-top:40px;border: 1px solid #322c4f; color:white; padding: 10px 5px"/> </apex:form>
After Correction , code will something like this below
All Answers
You need to add actionStatus tag in your vf page
and Some Css for the UI for spinner
To call this actionStatus spinner , we need to use apex:commandbutton attribute Status.
Final Code Snippet
Hope this helps you to understand about actionStatus.
After Correction , code will something like this below
Thank you for the help with this works brilliantly but when it completes the page redirection i have in my controller extension doesn't work properly anymore and only displays a blank screen when I have this in. The page redirection I have in works fine when this ActionStatus isnt in.