0

In a VF page I have a table like this :

<apex:pageBlockTable value="{!lPrest}" var="prest">

    <apex:column>
        <apex:facet name="header">Prestation</apex:facet>
        <apex:facet name="footer">footer</apex:facet>
        <apex:outputText value="{!prest.Ressource__c}"/>
    </apex:column>

    <apex:column value="{!prest.DO__c}"/>

    <apex:column value="{!prest.nombre_JH__c}">
        <apex:facet name="footer"></apex:facet>
    </apex:column>
    <apex:column value="{!prest.TJM_reel__c}">
        <apex:facet name="footer">column footer</apex:facet>
    </apex:column>
    <apex:column value="{!prest.TJM_PL__c}">
        <apex:facet name="footer">column footer</apex:facet>
    </apex:column>
    <apex:column value="{!prest.CA_total__c}">
        <apex:facet name="footer">column footer</apex:facet>
    </apex:column>
    <apex:column value="{!prest.CA_PL__c}">
        <apex:facet name="footer">column footer</apex:facet>
    </apex:column>
    <apex:column value="{!prest.CJM_moyen__c}">
        <apex:facet name="footer">column footer</apex:facet>
    </apex:column>
    <apex:column value="{!prest.Cout_tot__c}">
        <apex:facet name="footer">column footer</apex:facet>
    </apex:column>
    <apex:column value="{!prest.ME_taux__c}">
        <apex:facet name="footer">column footer</apex:facet>
    </apex:column>

  </apex:pageBlockTable>

I display this VF on a object layout (non standard opportunity)

For now I use it only with a custom controller like this :

public with sharing class Opportunite_PNL_Lightning_Controller {

public List<Prestation__c> lPrest {get;set;}
public Opportunite_custom__c opportunite {get;set;}

public Opportunite_PNL_Lightning_Controller() {
    lPrest = [SELECT Id, Ressource__c, DO__c, nombre_JH__c, TJM_reel__c, TJM_PL__c, CA_total__c, CA_PL__c, ME_taux__c, 
            CJM_moyen__c, Cout_tot__c
            FROM Prestation__c 
            WHERE Opportunite__c = :ApexPages.currentPage().getParameters().get('id')
            ORDER BY DO__c];

}

}

In this controller I retrive a list of another object, that I display in the table. But now I need to retrive the field of the opportuny on which I am (the record displayed) and I want to display some of it's field into the footer of my column.

I try to use the standardController and the extension like that :

<apex:page standardController="Opportunite_custom__c" extension="Opportunite_PNL_Lightning_Controller">

But I got an error when I compile :

Attribute extension not supported in in Opportunite_PNL_Lightning

1

You have few syntax error here.

 extension="Opportunite_PNL_Lightning_Controller">

This will be

 extensions="Opportunite_PNL_Lightning_Controller">

And also in class you need to change the constructor

public with sharing class Opportunite_PNL_Lightning_Controller {

public List<Prestation__c> lPrest {get;set;}
public Opportunite_custom__c opportunite {get;set;}

public Opportunite_PNL_Lightning_Controller(ApexPages.StandardController stdController) {
 System.debug(stdController.getRecord()); //It will give you current record detail

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.