Standard List Controller in Visualforce Page #inSalesforce
<apex:page standardController="Contact" recordSetVar="contacts" tabStyle="Contact" sidebar="false">
<apex:form>
<apex:pageBlock title="Contacts List" id="conList">
Filter:
<apex:selectList value="{!filterId }" size="1">
<apex:selectOptions value="{!listViewOptions}"/>
<apex:actionSupport event="onchange" reRender="conList"/>
</apex:selectList>
<apex:pageBlockTable value="{!contacts}" var="c" rows="5">
<apex:column value="{!c.FirstName}"/>
<apex:column value="{!c.LastName}"/>
</apex:pageBlockTable>
<table style="width: 100%">
<tr>
<td>
Page: <apex:outputText value=" {!PageNumber} of {!CEILING(ResultSize / PageSize)}"/>
</td>
<td align="center">
<apex:commandLink action="{!Previous}" value="Prev" rendered="{!HasPrevious}"/>
<apex:outputText style="color: #ccc;" value="Prev" rendered="{!NOT(HasPrevious)}"/>
<apex:commandLink action="{!Next}" value="Next" rendered="{!HasNext}"/>
<apex:outputText style="color: #ccc;" value="Next" rendered="{!NOT(HasNext)}"/>
</td>
<td align="right">
Records per page:
<apex:selectList value="{!PageSize}" size="1">
<apex:selectOption itemValue="5" itemLabel="5"/>
<apex:selectOption itemValue="20" itemLabel="20"/>
<apex:actionSupport event="onchange" reRender="conList"/>
</apex:selectList>
</td>
</tr>
</table>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:form>
<apex:pageBlock title="Contacts List" id="conList">
Filter:
<apex:selectList value="{!filterId }" size="1">
<apex:selectOptions value="{!listViewOptions}"/>
<apex:actionSupport event="onchange" reRender="conList"/>
</apex:selectList>
<apex:pageBlockTable value="{!contacts}" var="c" rows="5">
<apex:column value="{!c.FirstName}"/>
<apex:column value="{!c.LastName}"/>
</apex:pageBlockTable>
<table style="width: 100%">
<tr>
<td>
Page: <apex:outputText value=" {!PageNumber} of {!CEILING(ResultSize / PageSize)}"/>
</td>
<td align="center">
<apex:commandLink action="{!Previous}" value="Prev" rendered="{!HasPrevious}"/>
<apex:outputText style="color: #ccc;" value="Prev" rendered="{!NOT(HasPrevious)}"/>
<apex:commandLink action="{!Next}" value="Next" rendered="{!HasNext}"/>
<apex:outputText style="color: #ccc;" value="Next" rendered="{!NOT(HasNext)}"/>
</td>
<td align="right">
Records per page:
<apex:selectList value="{!PageSize}" size="1">
<apex:selectOption itemValue="5" itemLabel="5"/>
<apex:selectOption itemValue="20" itemLabel="20"/>
<apex:actionSupport event="onchange" reRender="conList"/>
</apex:selectList>
</td>
</tr>
</table>
</apex:pageBlock>
</apex:form>
</apex:page>
Comments
Post a Comment