I got a page with standard controller and extension.
<apex:page id="thePage" standardcontroller="Unit__c" extensions="Unit_Ext" ....
Then I have blinded output field with a child relationship.
<apex:outputPanel id="fields" ....
<apex:outputfield value="{!Unit__c.Tenant__r.AccountId}" ....
There is a dropdown field for Tenant__c
and it re-renders above output field when changed.
<apex:selectList multiselect="false" size="1" value="{!Unit__c.Tenant__c}">
<apex:actionSupport event="onchange" rerender="fields"/>
<apex:selectOptions value="{!Tenants}"/>
</apex:selectList>
When it rerender, Unit__c.Tenant__c
is getting updated but Unit__c.Tenant__r.AccountId
remain same.
How do i fix this ?
Unit__c
. Try binding it to different field.Unit__c.Tenant__r.AccountId
,Unit__c.Tenant__r
to be precise, your outputField will not change. It will hold the same old value.