I have the below code and I am trying to make the Call_Outcome__c field required based on what value was selected for Type field:
<apex:pageBlockSectionItem>
<apex:outputLabel value="Type" for="taskTypeIdOne"></apex:outputLabel>
<apex:actionRegion>
<apex:inputField value="{!taskObjOne.type}" required="TRUE" id="taskTypeIdOne">
<apex:actionSupport event="onChange" reRender="taskOneCallOutcomeOPPanelId"/>
</apex:inputField>
</apex:actionRegion>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem>
<apex:outputLabel value="Call Outcome" for="taskOneCallOutcomeId"/>
<apex:outputPanel id="taskOneCallOutcomeOPPanelId">
{!taskObjOne.type} <!-- This always displays call on the UI-->
<apex:inputField value="{!taskObjOne.Call_Outcome__c}"
required="{!IF(taskObjOne.type =='Call',"TRUE","FALSE")}"
id="taskOneCallOutcomeId"/>
</apex:outputPanel>
</apex:pageBlockSectionItem>
Call_Outcome__c field is always displayed as required irrespective of what I select for Type field and the {!taskObjOne.type}
component inside the outputpanel always displays the initial value of type field on page load.
What is wrong with this code?