3

I have a controller extension with the method GetAttributes that returns a list of Attribute objects, how can I iterate over them with apex:repeat?

Controller Method:

public List<Vitality_Check_Attribute__c> GetAttributes(){
    List<Vitality_Check_Attribute__c> attr = [SELECT Name, Id, Assessment_Group_ID__c, Assessment_Identifier__c, Attribute_ID__c, Attribute_Identifier__c, Attribute_Value__c, Case__c, Source_Type__c FROM Vitality_Check_Attribute__c WHERE Case__c = :CaseID];
    return attr;
}

Apex Code:

    <apex:pageBlockSection title="Vitality Check Attributes">
        <apex:pageBlock>
            <apex:repeat value="{!GetAttributes}" var="att">
            </apex:repeat>
        </apex:pageBlock>
    </apex:pageBlockSection>

This is the error I am getting:

" Error: Unknown property 'CaseStandardController.GetAttributes' "

0

1 Answer 1

7

You don't need to put "get" as it's resolved implicitly by Salesforce (getter methods are called as properties). so you should be able to use:-

<apex:repeat value="{!Attributes}" var="att">
</apex:repeat>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .