Monday, March 11, 2013

Usage of "ActionStatus" apex tag in Visualforce Page

Visualforce Page:

<apex:page standardController="Contact" recordSetVar="accs" extensions="ascls" >
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accs}" var="a">
                <apex:column headerValue="Contact Name" >
                    <apex:CommandLink value="{!a.name}" rerender="out" status="stat" >
                        <apex:param value="{!a.id}" name="p1"/>
                    </apex:commandLink>
                </apex:column>
            </apex:pageBlockTable>
            <apex:commandLink value="Previous" action="{!previous}"/> &nbsp;&nbsp;&nbsp;
            <apex:commandLink value="Next" action="{!next}"/>
        </apex:pageBlock>
     
        <apex:outputPanel id="out" >
        <div align="center">
            <apex:actionStatus id="stat">
                <apex:facet name="start">
                    <apex:image value="{!$Resource.loading}"/>
                </apex:facet>
                <apex:facet name="stop">
            <apex:detail subject="{!$CurrentPage.parameters.p1}" inlineEdit="true" relatedList="false"/>              
                </apex:facet>
            </apex:actionStatus>
        </div>
        </apex:outputPanel>
    </apex:form>
</apex:page>

Apex Class:

public with sharing class ascls {
    public ascls(ApexPages.StandardSetController controller) {
        controller.setPageSize(5);
                                                                                             }
                                              }

No comments:

Post a Comment