Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account" sidebar="false"> <apex:pageBlock > <apex:form > <apex:panelGrid columns="2"> <apex:outputLabel value="View:"/> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="list"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> </apex:panelGrid> <apex:pageBlockTable value="{!accounts}" var="a" id="list"> <apex:column value="{!a.Name}"/> <apex:column value="{!a.Site}"/> <apex:column value="{!a.Phone}"/> <apex:column value="{!a.Type}"/> </apex:pageBlockTable> </apex:form> </apex:pageBlock> </apex:page>
Please try the below code. You can get all the list view options by using the standard controller.
<apex:page standardController="Account" recordSetvar="accounts">
<apex:pageBlock title="Viewing Accounts">
<apex:form id="theForm">
<apex:panelGrid columns="2">
<apex:outputLabel value="View:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="list"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
<apex:pageBlockSection >
<apex:dataList var="a" value="{!accounts}" id="list">
{!a.name}
</apex:dataList>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>
Thanks,
Sowmya.
You can try the following code :
VF page :
Please mark as best answer if it helps you.
Thank You
Ajay Dubedi