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
Prema -Prema - 

Please let me know how can i get checked account's contacts and when i check contact it should show the record detail page. I have created the class but its not letting me to save one if the property.

public class AccountWrapper 
{

    public List<WrapperAccounts> wrapItems{set;get;}
    public List<WrapperAccounts> wrapConItems{set;get;}
    public List<WrapperAccounts> selectedItem{set;get;}
    public List<Contact> accContacts{set;get;}
      
    public Set<Id> accId=new Set<Id>();
    public AccountWrapper()
    {
        wrapItems=new List<WrapperAccounts>();
        List<Account> accItem2=new List<Account>([SELECT Name FROM Account limit 10]);
        wrapConItems=new List<WrapperAccounts>();
        for(Account a1:accItem2)
        {    
            boolean check=false;
            wrapItems.add(new WrapperAccounts(check,a1));
            
        }
        if(accId!=null)
        {
            for(Contact cx:conwrap)
            {
                wrapConItems.add(new WrapperAccounts(false,cx));
            }
        }
        
    }
//Defining pagference to perform actionsupport onclick event
public PageReference fetch()
{
    fetchRecords();
    return null;
}
public PageReference fetchCont()
{
    fetchConRecords();
    return null;
}
//Method to define fetchRecords which will fetch Related Contacts
public void fetchRecords()
    {
     accContacts=new List<Contact>(); 
     for(WrapperAccounts wraps : wrapItems)
     {
            if(wraps.selected==true)
            {
                accId.add(wraps.accList.Id);
            }
          System.debug('Selected Accounts:'+wraps);
             
      }
            System.debug('Accounts IDs:accId='+accId); 
          
    
         List<Contact> cons=[Select Name from Contact WHERE AccountId IN:accId];
          
              for(Contact con:cons)
              {
                      
                 accContacts.add(con);  
                
             }
                  System.debug('Contacts Lists:'+accContacts);

     }
 //method to fetch contact's detail page
 public Set<Id> conId=new Set<Id>();
 public void fetchConRecords()
    {
     
     for(WrapperAccounts contwraps : wrapConItems)
     {
            if(contwraps.conSel==true)
            {
                conId.add(contwraps.contLists.Id);
            }
          System.debug('Selected Contacts:'+contwraps);
             
      }
            
          
    
         List<Contact> conx2=[Select Id from Contact WHERE Id IN:conId];
          
          System.debug('Contacts Lists in conx2:'+conx2);

     }   
       
//Wrapper Class
public class WrapperAccounts
    {
        public boolean selected{set;get;}
        public Account accList{set;get;}
        public Contact contLists{set;get;}
        public boolean conSel{set;get;}
        
        public WrapperAccounts(Boolean sel,Account acc)
        {
            this.accList=acc;
            this.selected=sel;         
        }
        public WrapperAccounts(Boolean selec,Contact co)
        {
            this.conSel=selec;
            this.contLists=co;
        }
    }
}

<apex:page controller="AccountWrapper" sidebar="false">
<apex:form >
<apex:pageBlock >
            <apex:pageBlockButtons >
            <!--<apex:commandButton value="Select" action="{!fetchRecords}" reRender="block2" rerender="block3"/>-->
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Accounts" columns="3">
            <apex:pageBlockTable value="{!wrapItems}" var="c" id="table">
                <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c.selected}"/>
                   <apex:actionSupport event="onclick"  action="{!fetch}"/>
                </apex:column>
                <apex:column value="{!c.accList.Name}" headerValue="Account Name"/>
            </apex:pageBlockTable>
           
            
            <apex:pageBlockTable value="{!accContacts}" var="c1" id="block2">
            <apex:column headerValue="Select">
                   <!--<apex:inputCheckbox value="{!c1.conSel}"/>-->
                   <apex:actionSupport event="onclick"  action="{!fetchCont}"/>
                </apex:column>
            <apex:column value="{!c1.Name}" headerValue="Related Contacts Name"/>
            </apex:pageBlockTable>
            
            
            <apex:pageBlockTable value="{!accContacts}" var="d1" id="block3">
            <apex:column value="{!d1.Name}" headerValue="Contact Detail Page"/>
            </apex:pageBlockTable>
            </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 
Best Answer chosen by Prema -
Sorna JenefaSorna Jenefa
Sorry 

Try this one

<apex:page controller="AccountWrapper" sidebar="false">
<apex:form >
<apex:pageBlock >
            <apex:pageBlockButtons >
            <!--<apex:commandButton value="Select" action="{!fetchRecords}" reRender="block2" rerender="block3"/>-->
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Accounts" columns="3">
            <apex:pageBlockTable value="{!wrapItems}" var="c" id="table">
                <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c.selected}"/>
                   <apex:actionSupport event="onclick"  action="{!fetch}"/>
                </apex:column>
                <apex:column value="{!c.accList.Name}" headerValue="Account Name"/>
            </apex:pageBlockTable>
           

            
            <apex:pageBlockTable value="{!wrapConItems}" var="c1" id="block2">
            <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c1.conSel}"/>
                   <apex:actionSupport event="onclick"  action="{!fetchCont}"/>
                </apex:column>
            <apex:column value="{!c1.contLists.Name}" headerValue="Related Contacts Name"/>
            
            </apex:pageBlockTable>
            
            
            <apex:pageBlockTable value="{!conx2}" var="d1" id="DetailPageBlock">
            <apex:column value="{!d1.Name} {!d1.Phone}" headerValue="Contact Detail Page"/>
            <!--<apex:detail id=""/>-->
            </apex:pageBlockTable>
            </apex:pageBlockSection>
            
</apex:pageBlock>
</apex:form>
</apex:page>
 

All Answers

kamala swarnalathakamala swarnalatha
Hi,

May I know that the variable conwrap can be defined in which code

for(Contact cx:conwrap)
           {
           wrapConItems.add(new WrapperAccounts(false,cx));
           }

Thanks
K.Kamala
Sweet Potato Tec
Prema -Prema -
Hello Kamala,

Thanks for your response. It was mistakenly removed i had a list i.e. List<Contact> conwrap=[select FirstName,LastName,Email from Contact WHERE AccountID IN:accId];
But please let me know how can i show checkbox beside every contact which i am getting once i click on the checkbox beside acocunt. Whenever i am trying to save this line it gives me error:
 <!--<apex:inputCheckbox value="{!c1.conSel}"/>--> so i commented this.
Also how to show the selected contact's detail page in the third pageblock section. Please help me on this
kamala swarnalathakamala swarnalatha
Hi Prema,

Iam working on this issue i will get back to you after  solved..

Thanks,
K.Kamala,
Sweet Potato Tec..
Prema -Prema -
Hello Kamala,

Thanks for your response. but i have updated the code. Now it's giving  error for C1.FirstName and if i give only c1 then no error but i am not getting values in second block. Please check my updated code.
<apex:page controller="AccountWrapper" sidebar="false">
<apex:form >
<apex:pageBlock >
            <apex:pageBlockButtons >
            <!--<apex:commandButton value="Select" action="{!fetchRecords}" reRender="block2" rerender="block3"/>-->
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Accounts" columns="3">
            <apex:pageBlockTable value="{!wrapItems}" var="c" id="table">
                <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c.selected}"/>
                   <apex:actionSupport event="onclick"  action="{!fetch}"/>
                </apex:column>
                <apex:column value="{!c.accList.Name}" headerValue="Account Name"/>
            </apex:pageBlockTable>
           
            
            <apex:pageBlockTable value="{!wrapConItems}" var="c1" id="block2">
            <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c1.conSel}"/>
                   <apex:actionSupport event="onclick"  action="{!fetchCont}"/>
                </apex:column>
            <apex:column value="{!c1}" headerValue="Related Contacts Name"/>
            </apex:pageBlockTable>
            
            
            <apex:pageBlockTable value="{!accContacts}" var="d1" id="DetailPageBlock">
            <apex:column value="{!d1.Name}" headerValue="Contact Detail Page"/>
            <!--<apex:detail id=""/>-->
            </apex:pageBlockTable>
            </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


controller:
public class AccountWrapper 
{

    public List<WrapperAccounts> wrapItems{set;get;}
    public List<WrapperAccounts> wrapConItems{set;get;}
    public List<WrapperAccounts> selectedItem{set;get;}
    public List<Contact> accContacts{set;get;}  
    public Set<Id> accId=new Set<Id>();
    public AccountWrapper()
    {
        wrapItems=new List<WrapperAccounts>();
        List<Account> accItem2=new List<Account>([SELECT Name FROM Account limit 10]);
        wrapConItems=new List<WrapperAccounts>();
        List<Contact> conwrap=new List<Contact>([select FirstName,LastName from Contact WHERE AccountID IN:accId]);
        for(Account a1:accItem2)
        {    
            boolean check=false;
            wrapItems.add(new WrapperAccounts(check,a1));
            
        }
                
    }
    public AccountWrapper(List<Contact> c2)
    {
    System.debug('Inside Constructor');
        if((accId!=null)&&(accContacts!=null))
        {
            for(Contact cx:accContacts)
            {
                wrapConItems.add(new WrapperAccounts(false,cx));
            }
        }
    }
//Defining pagference to perform actionsupport onclick event
public PageReference fetch()
{
    fetchRecords();
    return null;
}
public PageReference fetchCont()
{
    fetchConRecords();
    return null;
}
//Method to define fetchRecords which will fetch Related Contacts
public void fetchRecords()
    {
     accContacts=new List<Contact>(); 
     for(WrapperAccounts wraps : wrapItems)
     {
            if(wraps.selected==true)
            {
                accId.add(wraps.accList.Id);
            }
          System.debug('Selected Accounts:'+wraps);
             
      }
            System.debug('Accounts IDs:accId='+accId); 
          
    
         List<Contact> cons=[Select Name from Contact WHERE AccountId IN:accId];
          
              for(Contact con:cons)
              {
                      
                 accContacts.add(con);  
                
             }
                  System.debug('Contacts Lists:'+accContacts);
               new AccountWrapper(accContacts);

     }
 //method to fetch contact's detail page
 public Set<Id> conId=new Set<Id>();
 public void fetchConRecords()
    {
     
     for(WrapperAccounts contwraps : wrapConItems)
     {
            if(contwraps.conSel==true)
            {
                conId.add(contwraps.contLists.Id);
            }
          System.debug('Selected Contacts:'+contwraps);
             
      }
            
          
    
         List<Contact> conx2=[Select Id from Contact WHERE Id IN:conId];
          
          System.debug('Contacts Lists in conx2:'+conx2);

     }   
       
//Wrapper Class
public class WrapperAccounts
    {
        public boolean selected{set;get;}
        public Account accList{set;get;}
        public Contact contLists{set;get;}
        public boolean conSel{set;get;}
        
        public WrapperAccounts(Boolean sel,Account acc)
        {
            this.accList=acc;
            this.selected=sel;         
        }
        public WrapperAccounts(Boolean selec,Contact co)
        {
            this.conSel=selec;
            this.contLists=co;
        }
    }
}

It's not invoking the Parameterized constructor. Hope you will get back soon to me after making this work 😊
Sorna JenefaSorna Jenefa
Hi

Try this code:

<apex:page controller="AccountWrapper" sidebar="false">
<apex:form >
<apex:pageBlock >
            <apex:pageBlockButtons >
            <!--<apex:commandButton value="Select" action="{!fetchRecords}" reRender="block2" rerender="block3"/>-->
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Accounts" columns="3">
            <apex:pageBlockTable value="{!wrapItems}" var="c" id="table">
                <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c.selected}"/>
                   <apex:actionSupport event="onclick"  action="{!fetch}"/>
                </apex:column>
                <apex:column value="{!c.accList.Name}" headerValue="Account Name"/>
            </apex:pageBlockTable>
                     
            <apex:pageBlockTable value="{!wrapConItems}" var="c1" id="block2">
            <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c1.conSel}"/>
                   <apex:actionSupport event="onclick"  action="{!fetchCont}"/>
                </apex:column>
            <apex:column value="{!c1.contLists.Name}" headerValue="Related Contacts Name"/>
             </apex:pageBlockTable>
                       
            <apex:pageBlockTable value="{!accContacts}" var="d1" id="DetailPageBlock">
            <apex:column value="{!d1.Name}" headerValue="Contact Detail Page"/>
            <!--<apex:detail id=""/>-->
            </apex:pageBlockTable>
            </apex:pageBlockSection>
            
</apex:pageBlock>
</apex:form>
</apex:page>

Controller:


public class AccountWrapper 
{

    public List<WrapperAccounts> wrapItems{set;get;}
    public List<WrapperAccounts> wrapConItems{set;get;}
    public List<WrapperAccounts> selectedItem{set;get;}
    public List<Contact> accContacts{set;get;}  
    public Set<Id> accId=new Set<Id>();
    public AccountWrapper()
    {
        wrapItems=new List<WrapperAccounts>();
        List<Account> accItem2=new List<Account>([SELECT Name FROM Account limit 10]);
        wrapConItems=new List<WrapperAccounts>();
        List<Contact> conwrap=new List<Contact>([select FirstName,LastName from Contact WHERE AccountID IN:accId]);
        for(Account a1:accItem2)
        {    
            boolean check=false;
            wrapItems.add(new WrapperAccounts(check,a1));
            
        }
                
    }
   
//Defining pagference to perform actionsupport onclick event
public PageReference fetch()
{
    fetchRecords();
    return null;
}
public PageReference fetchCont()
{
    fetchConRecords();
    return null;
}
//Method to define fetchRecords which will fetch Related Contacts
public void fetchRecords()
    {
     accContacts=new List<Contact>(); 
     
  
     for(WrapperAccounts wraps : wrapItems)
     {
            if(wraps.selected==true)
            {
                accId.add(wraps.accList.Id);
            }
          System.debug('Selected Accounts:'+wraps);
             
      }
            System.debug('Accounts IDs:accId='+accId); 
          
    
         List<Contact> cons=[Select Name from Contact WHERE AccountId IN:accId];
          
              for(Contact con:cons)
              {
                      
                 accContacts.add(con);  
                
             }
                  System.debug('Contacts Lists:'+accContacts);
                  
                 if((accId!=null)||(accContacts!=null))
        {
            for(Contact cx:accContacts)
            {
                wrapConItems.add(new WrapperAccounts(false,cx));
            }
        }
     }
 //method to fetch contact's detail page
 public Set<Id> conId=new Set<Id>();
 public void fetchConRecords()
    {
     
     for(WrapperAccounts contwraps : wrapConItems)
     {
            if(contwraps.conSel==true)
            {
                conId.add(contwraps.contLists.Id);
            }
          System.debug('Selected Contacts:'+contwraps);
             
      }
               
         List<Contact> conx2=[Select Id from Contact WHERE Id IN:conId];
          
          System.debug('Contacts Lists in conx2:'+conx2);

     }   
       
//Wrapper Class
public class WrapperAccounts
    {
        public boolean selected{set;get;}
        public Account accList{set;get;}
        public Contact contLists{set;get;}
        public boolean conSel{set;get;}
        
        public WrapperAccounts(Boolean sel,Account acc)
        {
            this.accList=acc;
            this.selected=sel;         
        }
        public WrapperAccounts(Boolean selec,Contact co)
        {
            this.conSel=selec;
            this.contLists=co;
        }
    }
}

This will help your requirement.If you have any doubt kindly ask me.

Kindly let me know will it works!

Thanks
Jenefa,Kamala,Saroja
Sweet Potato Tec
Prema -Prema -
Hello Kamala,

I just pasted your code it's working but i am not getting the contact detail in the 3rd block when i click on the contact checkbox.
Sorna JenefaSorna Jenefa
Sorry 

Try this one

<apex:page controller="AccountWrapper" sidebar="false">
<apex:form >
<apex:pageBlock >
            <apex:pageBlockButtons >
            <!--<apex:commandButton value="Select" action="{!fetchRecords}" reRender="block2" rerender="block3"/>-->
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Accounts" columns="3">
            <apex:pageBlockTable value="{!wrapItems}" var="c" id="table">
                <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c.selected}"/>
                   <apex:actionSupport event="onclick"  action="{!fetch}"/>
                </apex:column>
                <apex:column value="{!c.accList.Name}" headerValue="Account Name"/>
            </apex:pageBlockTable>
           

            
            <apex:pageBlockTable value="{!wrapConItems}" var="c1" id="block2">
            <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c1.conSel}"/>
                   <apex:actionSupport event="onclick"  action="{!fetchCont}"/>
                </apex:column>
            <apex:column value="{!c1.contLists.Name}" headerValue="Related Contacts Name"/>
            
            </apex:pageBlockTable>
            
            
            <apex:pageBlockTable value="{!conx2}" var="d1" id="DetailPageBlock">
            <apex:column value="{!d1.Name} {!d1.Phone}" headerValue="Contact Detail Page"/>
            <!--<apex:detail id=""/>-->
            </apex:pageBlockTable>
            </apex:pageBlockSection>
            
</apex:pageBlock>
</apex:form>
</apex:page>
 
This was selected as the best answer
Prema -Prema -
Its giving this error Error: Unknown property 'AccountWrapper.conx2'Create Apex property 'AccountWrapper.conx2'
Create Apex method 'AccountWrapper.getConx2'
Prema -Prema -
 <apex:pageBlockTable value="{!conx2}" var="d1" id="DetailPageBlock">
            <apex:column value="{!d1.Name} {!d1.Phone}" headerValue="Contact Detail Page"/>

I just made the conx2 getter setter and defined the FirstName and Phone in the query but still i am not getting the contact name or anything else. Also i dont want name of contact i want the detail page.
kamala swarnalathakamala swarnalatha
Hi Prema,

Remove 

List<Contact> conx2=[Select Id from Contact WHERE Id IN:conId]; 

as

conx2=[Select Id from Contact WHERE Id IN:conId];

not sure but the line is 126 in Apex class

Thanks.
Prema -Prema -
Hello Kamala,

this is my updated code: 
<apex:page controller="AccountWrapper" sidebar="false">
<apex:form >
<apex:pageBlock >
            <apex:pageBlockButtons >
            <!--<apex:commandButton value="Select" action="{!fetchRecords}" reRender="block2" rerender="block3"/>-->
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Accounts" columns="3">
            <apex:pageBlockTable value="{!wrapItems}" var="c" id="table">
                <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c.selected}"/>
                   <apex:actionSupport event="onclick"  action="{!fetch}"/>
                </apex:column>
                <apex:column value="{!c.accList.Name}" headerValue="Account Name"/>
            </apex:pageBlockTable>
           

            
            <apex:pageBlockTable value="{!wrapConItems}" var="c1" id="block2">
            <apex:column headerValue="Select">
                   <apex:inputCheckbox value="{!c1.conSel}"/>
                   <apex:actionSupport event="onclick"  action="{!fetchCont}"/>
                </apex:column>
            <apex:column value="{!c1.contLists.Name}" headerValue="Related Contacts Name"/>
            
            </apex:pageBlockTable>
            
            
            <apex:pageBlockTable value="{!conx2}" var="d1" id="DetailPageBlock">
            <apex:column value="{!d1.FirstName} {!d1.Email}" headerValue="Contact Detail Page"/>
            <!--<apex:detail id=""/>-->
            </apex:pageBlockTable>
            </apex:pageBlockSection>
            
</apex:pageBlock>
</apex:form>
</apex:page>

But still m nt getting detail page of the selected contact.
public class AccountWrapper 
{

    public List<WrapperAccounts> wrapItems{set;get;}
    public List<WrapperAccounts> wrapConItems{set;get;}
    public List<WrapperAccounts> selectedItem{set;get;}
    public List<Contact> accContacts{set;get;} 
    public List<Contact> conx2{set;get;}
    public Set<Id> accId=new Set<Id>();
    public AccountWrapper()
    {
        wrapItems=new List<WrapperAccounts>();
        List<Account> accItem2=new List<Account>([SELECT Name FROM Account limit 10]);
        wrapConItems=new List<WrapperAccounts>();
        List<Contact> conwrap=new List<Contact>([select FirstName,LastName from Contact WHERE AccountID IN:accId]);
        for(Account a1:accItem2)
        {    
            boolean check=false;
            wrapItems.add(new WrapperAccounts(check,a1));
            
        }
                
    }
   
//Defining pagference to perform actionsupport onclick event
public PageReference fetch()
{
    fetchRecords();
    return null;
}
public PageReference fetchCont()
{
    fetchConRecords();
    return null;
}
//Method to define fetchRecords which will fetch Related Contacts
public void fetchRecords()
    {
     accContacts=new List<Contact>(); 
     
  
     for(WrapperAccounts wraps : wrapItems)
     {
            if(wraps.selected==true)
            {
                accId.add(wraps.accList.Id);
            }
          System.debug('Selected Accounts:'+wraps);
             
      }
            System.debug('Accounts IDs:accId='+accId); 
          
    
         List<Contact> cons=[Select Name from Contact WHERE AccountId IN:accId];
          
              for(Contact con:cons)
              {
                      
                 accContacts.add(con);  
                
             }
                  System.debug('Contacts Lists:'+accContacts);
                  
                 if((accId!=null)||(accContacts!=null))
        {
            for(Contact cx:accContacts)
            {
                wrapConItems.add(new WrapperAccounts(false,cx));
            }
        }
     }
 //method to fetch contact's detail page
 public Set<Id> conId=new Set<Id>();
 public void fetchConRecords()
    {
     
     for(WrapperAccounts contwraps : wrapConItems)
     {
            if(contwraps.conSel==true)
            {
                conId.add(contwraps.contLists.Id);
            }
          System.debug('Selected Contacts:'+contwraps);
             
      }
               
         conx2=[Select FirstName,LastName,Email,Phone from Contact WHERE Id IN:conId];
          
          System.debug('Contacts Lists in conx2:'+conx2);

     }   
       
//Wrapper Class
public class WrapperAccounts
    {
        public boolean selected{set;get;}
        public Account accList{set;get;}
        public Contact contLists{set;get;}
        public boolean conSel{set;get;}
        
        public WrapperAccounts(Boolean sel,Account acc)
        {
            this.accList=acc;
            this.selected=sel;         
        }
        public WrapperAccounts(Boolean selec,Contact co)
        {
            this.conSel=selec;
            this.contLists=co;
        }
    }
}

 
kamala swarnalathakamala swarnalatha
Hi Prema,

Now only We understand your requirement clearly.

We are  working on this and get back you to after solved.

May I know that the contact detail page to shown in the third section or in another page.

Thanks.
Prema -Prema -
Thanks you so much for your co-opeartion Kamala:)
Prema -Prema -
I have done that kamala on my own but i dont know how to fix the vf page. let me share the image and code
Prema -Prema -
User-added image
Prema -Prema -
I dont understand why it shows the Name of the contact on the top of the page.
kamala swarnalathakamala swarnalatha
Hi Prema,

Hey I get  back   to  ASAP.

Thanks.
kamala swarnalathakamala swarnalatha
Hi Prema,

Will you please send me the updated code?

Thanks.
 
Prema -Prema -
Sent that already.. Can u help me with the Related list how can i get related list irrespcetive of type..? with Dele. and Edit button bside every related lists of Contact?
kamala swarnalathakamala swarnalatha
Hi Prema,

Thanks for marking as the best answer am trying for the related list to shown get back to as soon as possible.

Thanks,
K.Kamala,Jenefa
kamala swarnalathakamala swarnalatha
Hi Prema,

Try this one 

<apex:relatedList list="Opportunities" />
    <apex:relatedList list="Contacts">
        <apex:facet name="header">Titles can be overriden with facets</apex:facet>
    </apex:relatedList>
    <apex:relatedList list="Cases" title="Or you can keep the image, but change the text" />

Thanks,
K.Kamala,Saroja
Prema -Prema -
I want the related list to be enclosed with Checkbox beside every records.