+ Start a Discussion

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}"/>

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?