I have a VisualForce page that should pass the selected value to the controller action based on the selection but I'm getting the null
employee__c.dept_c
is a picklist datatype
Here is my following Visualforce page:
<apex:inputField value="{!employee__c.dept_c}">
<apex:actionSupport event="onchange" action="{!deptOnChange}" />
<apex:param name="re" value="{!employee__c.dept_c}" assignTo="{!selectedDept}" />
</apex:inputField>
Controller:
public string selectedDept {get;set;}
public void deptOnChange()
{
system.debug('deptOnChange: ' + selectedDept );
}
Best Answer
I able to figured out, hope this will help others:
Visualforce page:
Controller: