function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
badrul Hassanbadrul Hassan 

How to show view list of contacts on vf controller?

Amit Chaudhary 8Amit Chaudhary 8
Please check below code. I hope that will help you
<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account" sidebar="false">
    <apex:pageBlock >
          <apex:repeat value="{!accounts}" var="a">
<apex:pageBlockSection title="{!a.name}"></apex:pageBlockSection>
  <apex:relatedList list="Contacts" subject="{!a.Id}"/>
<apex:relatedList list="Opportunities" subject="{!a.Id}" />
</apex:repeat>      
     </apex:pageBlock>
</apex:page>
Please let us know if this will help u

 
badrul Hassanbadrul Hassan
Thanks for your reply but i want to show  view list of contacts on custom
 vf controller?
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help  you
http://www.jitendrazaa.com/blog/salesforce/listview-filter-in-apex-with-paging-and-navigation/
http://salesforce.stackexchange.com/questions/32067/custom-list-view-to-display-vf-page

Try below code.
<apex:page standardController="Contact" recordSetVar="Contacts">
   <apex:pageBlock >
    <Table border="1"> 
        <apex:repeat value="{!Contacts}" var="c">
           <TR> 
            <TD>
                <apex:outputText value="{!c.FirstName}"/>
            </TD>
            <TD>
                <apex:outputText value="{!c.LastName}"/>
            </TD>
           </TR> 
        </apex:repeat>
    </Table> 
   </apex:pageBlock> 
</apex:page>
Other wise you can try below post for code.
http://www.jitendrazaa.com/blog/salesforce/listview-filter-in-apex-with-paging-and-navigation/

Please let us know if this will help you