I have a controller with extesion from which I try to pass the subtitle values to my visualforce page but I cant seem ro render it.

My system.debug('subtitle 1 '+ subtitle ); gives : subtitle 1 {Demo, Final}

Here is my VFP:

<apex:page standardController="Quote__c"  extensions="quotelineItems" contentType="application/msword#Quote {!Quote__c.Name}.doc" cache="true" >
  <html xmlns:w="urn:schemas-microsoft-com:office:word">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <body style="font-family:Tahoma,serif;font-size: 11pt;margin:2cm;">
    <apex:repeat var="subt" value="{!subtitle}">


global with sharing class quotelineItems {

    global set<string>  subtitle {get;set;}
    public String currentRecordId {get;set;}

    public quotelineItems(ApexPages.StandardController controller) {
    currentRecordId = ApexPages.CurrentPage().getparameters().get('id');

    List<Quote_Line_Item__c> myQli = [SELECT id, Subtitle__c, Quote__c FROM Quote_Line_Item__c  WHERE Quote__c =:currentRecordId ORDER by Subtitle__c]; 

    set<string> subtitle = new set<string>();  
        for(Quote_Line_Item__c q : myQli ) {
            subtitle.add(q.Subtitle__c );
        system.debug('subtitle 1 '+ subtitle );
        Apexpages.currentPage().getHeaders().put('content-disposition', 'inline; filename='+myQli[0].Quote__c+'-'+date.today().format()+'.pdf');

    public set<string> getsubtitle() { 
        system.debug('subtitle 2 '+ subtitle );
        return subtitle;

You are setting a local variable rather than your controller property.


Set<String> myProperty { get; set; }
public MyExtension(ApexPages.StandardController controller)
    Set<String> myProperty = new Set<String>();


Set<String> myProperty { get; set; }
public MyExtension(ApexPages.StandardController controller)
    myProperty = new Set<String>();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.