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
Sudhir_MeruSudhir_Meru 

Visualforce not displaying values from extensions

Hi, 

 I wrote a controller later it was used as a extension inside visualforce due to standardcontroller was used.
 
 Below is the Apex Class

 public class renewal_contract
{
    public renewal_contract(ApexPages.StandardController Cont ) {

    }
      
   String conId = ApexPages.currentPage().getParameters().get('Id');
  
    public List<Contract_Lines__c> Cont {get;set;}
    public renewal_contract()
    {
   
        Cont = [SELECT Serial_Number__c,
                       ContractLineNumber__c,
                       Service_Item_Description__c,
                       Service_Start_Date__c,
                       Service_End_Date__c,
                       Sub_Line_Status__c
                FROM Contract_Lines__c
                WHERE Contract__c = :conId ];
    }   
}


Visual force page to display values 

<apex:page sidebar="false" showheader="false"  standardController="contract"  extensions="renewal_contract">

<header>
<h1>Create Renewal Quote
</h1>
</header>
<br/><br/>

<b> Account Name  : </b>  {!Contract.Account.Name}
<br/><br/> 

<p> Existing Install base for <b> {!Contract.Account.Name} </b> </p>


<apex:pageBlock >
        <apex:pageBlockTable value="{!Cont}" var="c">
      
            <apex:column value="{!c.Contract__c}" />
            <apex:column value="{!c.Asset__c}"/>
            <apex:column value="{!c.Serial_Number__c}" />
            <apex:column value="{!c.Service_Item_Description__c}"/>
            <apex:column value="{!c.Date_Terminated__c}"/>
           
        </apex:pageBlockTable>
    </apex:pageBlock>




</apex:page>

Above visual force page is not displaying any values after chaning it to extensions please suggest me how to change

Thanks
Sudhir
Best Answer chosen by Sudhir_Meru
Ranjeet Singh (SFDC Developer)Ranjeet Singh (SFDC Developer)
inside the Standard controller use. this method to call the constructor.
public renewal_contract(ApexPages.StandardController Cont ) {
   this();
 }

All Answers

Ranjeet Singh (SFDC Developer)Ranjeet Singh (SFDC Developer)
inside the Standard controller use. this method to call the constructor.
public renewal_contract(ApexPages.StandardController Cont ) {
   this();
 }
This was selected as the best answer
Sudhir_MeruSudhir_Meru
Thanks Ranjeet it worked. Thanks for Help