0

spinner not showing when click on search button

<apex:stylesheet value="{!URLFOR($Resource.SLDS080, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
<apex:page>
<apex:form id="frm">
<apex:actionstatus id="counterStatus">
                    <apex:facet name="start">
                        <div class="waitingSearchDiv" id="el_loading">
                            <div class="slds-modal-backdrop slds-modal-backdrop--open" id="exportLoadingDiv" style=" z-index: 10000000;">
                                <div style="position:fixed; top: 50%; left: 50%; margin-top: -45px; margin-left: -45px;">
                                    <img src="{!URLFOR($Resource.SLDS080,'/assets/images/spinners/slds_spinner_brand.gif')}" style="width:62px;"/>
                                        <br/>
                                        <div style="position: relative;margin-left: -86px;color: white;font-weight: 600;" class="exportMsg"></div>
                                </div>
                            </div>
                        </div>
                    </apex:facet>
</apex:actionstatus>


<div class="slds">
    <apex:pageBlock id="pb1">
            <apex:pageMessages />

<apex:actionFunction name="sayHello" action="{!searchbox}" reRender="tstpopup,btn-box" status="counterStatus"/>

 <apex:pageBlockSection columns="4" collapsible="true" title="Record" showHeader="true">
    <apex:inputText value="{!searchBoxstring}" label="Search" styleclass="slds-input"/>

       <apex:outputPanel id="btn-box">
       <apex:commandButton value="Search" onClick="sayHello(); return false;" styleClass="slds-button slds-button--neutral" style="display:inline; float:left;"/>
        <apex:commandButton value="Add New" action="{!showPopup}" rerender="tstpopup" styleClass="slds-button slds-button--neutral" style="display:inline; float:left;" />
        </apex:outputPanel>
        <apex:outputPanel id="tstpopup">
            <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
                <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}">

                 <table width="100%" class="slds-table slds-table--bordered" id="tab1">
                     <tr class="slds-text-heading--label">
                         <td>First Name: </td>
                         <td><apex:InputField value="{!con.firstName}" styleclass="slds-input"/></td>
                     </tr>
                     <tr class="slds-text-heading--label">
                         <td> Last Name: </td>
                         <td> <apex:InputField value="{!con.LastName}" styleclass="slds-input" /> </td>
                    </tr>
                     <tr class="slds-text-heading--label">
                         <td>Email:</td>
                         <td><apex:InputField value="{!con.Email}" styleclass="slds-input"/></td>
                     </tr>
                     <tr class="slds-text-heading--label">
                         <td>Phone: </td>
                         <td><apex:InputField value="{!con.Phone}" styleclass="slds-input"/></td>
                     </tr>
                     <tr class="slds-text-heading--label">
                         <td>Account Name: </td>
                         <td><apex:InputField value="{!con.AccountId}" styleclass="lookupInput Img"/> </td>

                     </tr>
                 </table>
                 <br/><br/>
                    <apex:commandButton value="Save" action="{!save}" rerender="pb1" styleClass="slds-button slds-button--neutral slds-button--brand"/>
                    <apex:commandButton value="Cancel" action="{!closePopup}" styleClass="slds-button slds-button--neutral" immediate="true"/>
                </apex:outputPanel>
         </apex:outputPanel>
</apex:form>
</apex:page>
0

2 Answers 2

2

You have defined the actionstatus but you are not using it. So whenever you want to display status just use status="counterStatus".

Just add it in commandbutton or any other actionfunction.

0

In your code you are calling <apex:actionFunction from <apex:commandButton and from <apex:actionFunction you are updating the status.

You can use status attribute of <apex:commandButton directly as below without <apex:actionFunction.

<apex:commandButton value="Search" action="{!searchbox}" reRender="tstpopup,btn-box" status="counterStatus" styleClass="slds-button slds-button--neutral" style="display:inline; float:left;"/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .