Are you passing an object to a component? Objects are passed by reference, so if your component has an attribute that takes an object and does something with it, your external page editor will be able to access the changed values.
If you were to pass a wrapper object, i.e. if your user interface allows the user to select an account.
Class SelectedAccount { public Account theAccount {get;set;} }
component:
<apex:component controller="ComponentController"> <apex:attribute type="SelectedAccount" name="userSelectedAccount" description="Selected Account" assignTo="{!selectedAccount}" </apex:component>
Component Controller:
public class ComponentController { public selectedAccount; public void ComponentController(){} public PageReference selectAccountFromUI(Account selected) { selectedAccount.theAccount = selected; return null; } }
Component Usage Page:
<c:MyAccountComponent userSelectedAccount="{!instanceOfSelectedAccount}"/>
This will allow you to assign the user-selected account to an instance of the wrapper object that belongs to the external controller. Then you can specify:
instanceOfSelectedAccount.theAccount
from the main controller Visualforce Pages.
source share