Trouble with Action Support
Currently, I have been very successful with my page until I ran into a snag with my action:support tag.
I simply need to collect an Id, collected on the a form, then based on that Id, alter a Boolean for rendering purposes.
However, the value being bound is not being set or captured. Even more odd is that when I set immediate to true, the Id parameter called PossibleWhoId is being populated with a null value. As for if it is false, it doesn't even show up in ViewState.
Needless to say, there is a slight anomaly here.
The VisualForce Code
...
<apex:pageBlockSection>
<apex:inputField value="{!Task[TaskField]}" required="{!TaskField.Required}" id="Who">
<apex:actionSupport event="onchange" reRender="TaskPageBlockButtons" id="Name" action="{!DisableOrEnableAddOfficeContactButton}" immediate="true">
<apex:param name="PossibleWho" assignTo="{!PossibleWhoId}" value="{!Task[TaskField]}"/>
</apex:actionSupport>
</apex:inputField>
</apex:pageBlockSection>
...
The Apex Code
public Id PossibleWhoId { get; set; }
public PageReference DisableOrEnableAddOfficeContactButton()
{
this.IsNotPrimaryContact = this.CurrentTask.WhoId == null
|| this.CurrentTask.WhoId.getsObjectType().getDescribe().getName() != 'Contact';
return null;
}