SoqlExample1:
<apex:page controller="SoqlExample1">
<apex:form >
<apex:pageBlock title="SoqlExample1">
<apex:pageBlockButtons location="top">
<apex:commandButton value="Sort By Name" action="{!getSortByName}" reRender="dataTable"/>
<apex:commandButton value="Sort By Industry" action="{!getDescOrder}" reRender="dataTable"/>
<apex:commandButton value="Limits" action="{!getLimits}" reRender="dataTable"/>
<apex:commandButton value="Offset" action="{!getOffset}" reRender="dataTable"/>
<apex:commandButton value="All Records" action="{!getAllRecords}" reRender="dataTable"/>
<apex:commandButton value="Recycle Bin" action="{!getDeletedRecords}" reRender="dataTable"/>
<apex:commandButton value="Pagination" action="{!getPagination}" reRender="dataTable"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!accs}" var="a" id="dataTable">
<apex:column value="{!a.Id}"/>
<apex:column headerValue="Name">
<apex:outputLink value="/{!a.Id}">{!a.Name}</apex:outputLink>
</apex:column>
<apex:column value="{!a.industry}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
<!--
总结:
1、reRender控制着异步刷新某一指定的区块,通过Id关联展示数据的源;
2、location表示按钮出现的位置,不指定显示上下两个按钮;
--><apex:page controller="SoqlExam