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
RajashriRajashri 

Remove Repetative Headers in VF page

Hi,

I have designed the Visual Force page but in my page Header is repetative for each record..Can anyone please tell me how to modify this page so that it will show only one header row..

Below is my Page
<apex:page StandardController="Campaign"  extensions="singleListView">
<apex:form >
        <apex:pageBlock title="Campaign Members Details New Modified Code For Lead Ids" mode="maindetail">
                                <apex:pageBlockSection title="Campaign Members"  id="cm3">
                      

                <apex:pageblocktable value="{!CampaignMembers}" var="cm">
                <!-- <apex:column headerValue="Name">
                                 <apex:outputfield value="{!cm.Name}"/>
                                  </apex:column>-->

                           <apex:column >
              

                               <apex:pageblocktable value="{!cm.CampaignMembers}" var="cpm"> 
                                 <apex:column headerValue="Action">
                               
                          
       <apex:outputLink title="" value="/{!cpm.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="font-weight:bold">Edit</apex:outputLink>&nbsp;|&nbsp;
       <a href="javascript:if (window.confirm('Are you sure?')) DeleteCampaignId('{!cpm.Id}');" style="font-weight:bold">Del</a>
     </apex:column>
                           

                                   <apex:column headerValue="Status">

                                       <apex:outputfield value="{!cpm.Status}" rendered="{!cpm.Status != null}"/>

                                    </apex:column> 
                                   
                                  <apex:column headerValue="Name">
                                 <apex:outputfield value="{!cpm.LeadID}" rendered="{!cpm.LeadID != null}"/>
                                  </apex:column>
                                  <apex:column headerValue="Phone">
                                 <apex:outputfield value="{!cpm.Lead.Phone}" rendered="{!cpm.Lead.Phone != null}"/>
                                  </apex:column>
                                    <apex:column headerValue="Mobile">
                                 <apex:outputfield value="{!cpm.Lead.MobilePhone}" />
                                  </apex:column>  
                                  <apex:column headerValue="Email">
                                 <apex:outputfield value="{!cpm.Lead.Email}" rendered="{!cpm.Lead.Email != null}"/>
                                  </apex:column>
                                  <apex:column headerValue="Last Modified Date">
                                 <apex:outputfield value="{!cpm.lastmodifieddate}" rendered="{!cpm.lastmodifieddate != null}"/>
                                  </apex:column>     
                                                                                           

                               </apex:pageblocktable>

                </apex:column>
                        
                   <apex:column >

                               <apex:pageblocktable value="{!cm.ActivityHistories}" var="tm">

                                   <apex:column headerValue="Subject">

                                       <apex:outputfield value="{!tm.Subject}"  rendered="{!tm.Subject != null}"/> 
                                                                       
                                       

                                   </apex:column>
                                    <apex:column headerValue="Last Modified Date">
                               <apex:outputfield value="{!tm.LastmodifiedDate}" rendered="{!tm.LastmodifiedDate != null}"/>
                         </apex:column>

                               </apex:pageblocktable>

                           </apex:column>

            </apex:pageblocktable>

            
                         </apex:pageBlockSection>
        </apex:pageBlock>

    </apex:form>

</apex:page>
Sforce.NinjaSforce.Ninja
You have campainMembers inside the list of campainMembers? can you share the data model of 'CampaignMembers'
RajashriRajashri
Below is my controller code...

public with sharing class CampaignMemController {
    public Campaign camp {get; set; }
    public CampaignMemController(ApexPages.StandardController controller) {
     camp = (Campaign)controller.getRecord();
    }
  
    List<Lead> sLead = new List<Lead>([SELECT id FROM Lead]);
    List<Lead> leadlist = new list<Lead>();
    public List<Lead> CampaignMembers;
    public List<Lead> getCampaignMembers() {
       CampaignMembers=[Select Id,Name,(Select id, Campaign.Name,Contact.Phone,Lead.FirstName,Lead.LastName,LeadID,ContactID,Lead.Phone,Lead.Email, Lastmodifieddate,Status,CampaignId,Campign_ID__c,Lead.MobilePhone  From CampaignMembers where CampaignId =:camp.Id and Status != '' and LeadId IN : slead ), 
(Select Subject, Id,lastModifiedDate From ActivityHistories  where lastModifiedDate !=null and Subject !=null order by LastModifiedDate desc limit 1) 
 from Lead WHERE Id IN : slead and Name !=NULL  order by LastModifiedDate desc];
       return CampaignMembers;
       }
     
        
     }
RajashriRajashri
Got the answer..Use <apex:repeat>