0

I am trying to get an action status to gray out the page while the DML update is in progress. I have had success with this on other pages but I can't get it to work on this one.

Can someone tell me what I am doing wrong? Should the actionstatus always go in a particular section of the page code?

<apex:page controller="EmpMerge_Controller">

    <style>
        #header {
        color:White;
        text-weight:bold;
        text-align:center;
        padding:5px;
        width:80%;
        align:center;
        }
        #nav {
        width:15%;
        float:left;
        padding:5px;
        color:black;
        }
        #section {
        width:100%;
        float:left;
        }
        .selected {
        color:black;
        }
        .selected:hover {
        color:blue;
        }
    </style> 
    <!-- -->
    <apex:form >
        <div id="section"> 

            <apex:pageblock tabStyle="Employee_Session__c" title="Transfer Details">
                <apex:actionStatus id="tbloading">
                    <apex:facet name="start">
                        <div style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.50; z-index: 1000; background-color: gray;">
                            &nbsp;
                        </div>
                        <div style="position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: 1001; margin: 20% 50%; color:white;">
                            <img src="/img/loading32.gif"/>
                        </div >
                    </apex:facet>
                </apex:actionStatus>

                <apex:pageBlockSection columns="2">
                    <apex:outputLabel value="Current HBS ID:" style="font-weight:bold;"/>
                    <apex:outputLabel value="New HBS ID:" style="font-weight:bold;"/>
                    <apex:outputLabel value="{!empName}" style="font-weight:bold;"/>
                    <apex:inputField label="HBS ID:" id="pickerHBSID" value="{!emp.Employee__c}" required="true" />
                </apex:pageBlockSection>
                <apex:pageBlockSection columns="1">
                    <apex:commandButton action="{!mergeRecords}" title="Transfer" value="Transfer" status="tbloading" >
                    </apex:commandButton>                
                </apex:pageBlockSection>
            </apex:pageblock>

            <apex:pageblock tabStyle="Employee_Session__c" title="Records for Transfer">
                <apex:pageBlockSection title="Sessions" collapsible="false" columns="1">
                    <apex:pageBlockTable value="{!EmpSessions}" var="ES" id="Detail" >
                        <apex:column headerClass="headerClass">
                            <apex:facet name="header">Session Name</apex:facet>
                            <apex:outputField value="{!ES.Name}" />
                        </apex:column>
                        <apex:column headerClass="headerClass">
                            <apex:facet name="header">Specialist</apex:facet>
                            <apex:outputField value="{!ES.Specialist__c}" />
                        </apex:column>
                        <apex:column headerClass="headerClass">
                            <apex:facet name="header">Created Date</apex:facet>
                            <apex:outputField value="{!ES.CreatedDate}" />
                        </apex:column>
                        <apex:column headerClass="headerClass">
                            <apex:facet name="header">Last Modified Date</apex:facet>
                            <apex:outputField value="{!ES.LastModifiedDate}" />
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Tasks" collapsible="false" columns="1"> 
                    <apex:pageBlockTable value="{!Tasks}" var="tsk">
                        <apex:column headerClass="headerClass">
                            <apex:facet name="header">Subject</apex:facet>
                            <apex:outputField value="{!tsk.Subject}" />
                        </apex:column>
                        <apex:column headerClass="headerClass">
                            <apex:facet name="header">CreatedDate</apex:facet>
                            <apex:outputField value="{!tsk.CreatedDate}" />
                        </apex:column>
                        <apex:column headerClass="headerClass">
                            <apex:facet name="header">Record ID</apex:facet>
                            <apex:outputField value="{!tsk.Id}" />
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
            </apex:pageblock>
        </div>
    </apex:form>
</apex:page>
  • FYI, the save button is about 8 lines down from the close of actionstatus – Matt M Jun 15 '16 at 14:20
  • 1
    try re-rendering something some section on the command button, rerender="some component Id" – Anurag Jun 15 '16 at 14:30
  • Oh hahahahahah wow, yep that was it. – Matt M Jun 15 '16 at 14:36
1

try re-rendering something some section on the command button, rerender="some component Id"

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.