Simple use case of passing a parent controller's instance to a custom VF component's attribute to allow for inter-controller communication
Component
<apex:component id="SomeComponent">
<apex:attribute name="controller" type="SomeParentController" description="the parent (calling) controller"/>
</apex:component>
VF Page
<apex:page id="SomeVF" controller="SomeParentController">
<c:SomeComponent controller="{!this}"/>
</apex:page>
Main VF Controller
public with sharing class SomeParentController {
public SomeParentController getThis() {return this;}
}
When compiling the VF page - get this error on the line c:SomeComponent ...
:
Wrong type for attribute . Expected SomeParentController, found String