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
Volker_factory42Volker_factory42 

Getting data of 3 Level relation in Controller

My Problem: I'd like to show a 3 Level Object Relation in a VF, i.e. Account.Contacts.Emailadresses.

I can't write a Getcontroller to receive all data (all 3 Levels of relation).
So my idea was, to have a visualforcepage coming from 1st Leve (Account) and ad an apex:repeat to call a component (which includes a Getcontroller with Level 2 and 3 (Contact and Emailadresses)

I can call a component and give it a value with
   
    <c:MyComponent ParameterID="!Account.Contacts.id"/>
   
    In here, it is not  possible to send a variable with {}. I receive an error: Unknown... VisualforceArrayList.id

In my component I recieve this attribute:
   
    <apex:component controller="MyCustomeController">
        <apex:attribute name="ParameterID" description="Contact ID from VF." type="ID" required="true"/>
        <apex:outputText value="{!ParameterID}"/>
    </apex:component>

First Problem: Instead of an ID I can only send a String ({!Account.Contacts.id}).
Second: How can I take this ID to my customcontroller of this component=?

Or is there another solution to get all three level in 1 getcontroller?