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
Lukas Razim 17Lukas Razim 17 

Apex Rendered

Hi,
I need to print out stickers(addresses) for envelopes to be sent out for campaign members who registered for my campaign (means they have status Registered), so the code below with custom button on campaign generates such list to be printed. However I kind of struggle with "rendered", the bold part of the code causes me troubles, Im getting error Generate_Stickers line 12, column 23: The element type "apex:pageBlockSectionItem" must be terminated by the matching end-tag "</apex:pageBlockSectionItem>"  
What am I doing wrong? Many thanks
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false" >
      <apex:pageBlock >
          <apex:pageBlockSection columns="3" showHeader="false">
                <apex:repeat value="{!Campaign.CampaignMembers}" var="line" >   
                    <apex:pageBlockSectionItem rendered="{!line.Status="Registered"}" dataStyle="width:33%" labelStyle="width:33%" >
    
                    {!line.Contact.Name}<BR/>
                    {!line.Contact.MailingStreet}<BR/>
                    {!line.Contact.MailingPostalCode} {!line.Contact.MailingCity}<BR/>
                    {!line.Contact.MailingCountry}<BR/>  
                    
                    </apex:pageBlockSectionItem>
                </apex:repeat>
          </apex:pageBlockSection>
      </apex:pageBlock> 
</apex:page>

 
Best Answer chosen by Lukas Razim 17
Gaurav_SrivastavaGaurav_Srivastava
Hi Lukas,

Try below code:
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false" >
      <apex:pageBlock >
          <apex:pageBlockSection columns="3" showHeader="false">
                <apex:repeat value="{!Campaign.CampaignMembers}" var="line" >   
                    <apex:pageBlockSectionItem rendered="{!line.Status='Registered'}" dataStyle="width:33%" labelStyle="width:33%" >
    
                    {!line.Contact.Name}<BR/>
                    {!line.Contact.MailingStreet}<BR/>
                    {!line.Contact.MailingPostalCode} {!line.Contact.MailingCity}<BR/>
                    {!line.Contact.MailingCountry}<BR/>  
                    
                    </apex:pageBlockSectionItem>
                </apex:repeat>
          </apex:pageBlockSection>
      </apex:pageBlock> 
</apex:page>

Thanks,
Gaurav

All Answers

Mahesh DMahesh D
Try this:
 
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false" >
      <apex:pageBlock >
          <apex:pageBlockSection columns="3" showHeader="false">
                <apex:repeat value="{!Campaign.CampaignMembers}" var="line" >   
                    <apex:pageBlockSectionItem rendered="{!line.Status="Registered"}" dataStyle="width:33%" labelStyle="width:33%" >
    
                    {!line.Contact.Name}<BR/>
                    {!line.Contact.MailingStreet}<BR/>
                    {!line.Contact.MailingPostalCode} {!line.Contact.MailingCity}<BR/>
                    {!line.Contact.MailingCountry}<BR/>  
                    
                    </apex:pageBlockSectionItem>
                </apex:repeat>
          </apex:pageBlockSection>
      </apex:pageBlock> 
</apex:page>

Please let me know if this helps.

Regards,
Mahesh
Gaurav_SrivastavaGaurav_Srivastava
Hi Lukas,

Try below code:
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false" >
      <apex:pageBlock >
          <apex:pageBlockSection columns="3" showHeader="false">
                <apex:repeat value="{!Campaign.CampaignMembers}" var="line" >   
                    <apex:pageBlockSectionItem rendered="{!line.Status='Registered'}" dataStyle="width:33%" labelStyle="width:33%" >
    
                    {!line.Contact.Name}<BR/>
                    {!line.Contact.MailingStreet}<BR/>
                    {!line.Contact.MailingPostalCode} {!line.Contact.MailingCity}<BR/>
                    {!line.Contact.MailingCountry}<BR/>  
                    
                    </apex:pageBlockSectionItem>
                </apex:repeat>
          </apex:pageBlockSection>
      </apex:pageBlock> 
</apex:page>

Thanks,
Gaurav
This was selected as the best answer