function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Matt Cooper 7Matt Cooper 7 

Visualforce Lookup Inputfield not passing value into controller

I am trying to pass the value of an inputfield for a lookup field from my Visualforce page to my controller. I can't seem to figure out why, but it continues to return a null value. See below for some snippets of the code. If the below isn't enough and you need more of the code, let me know and I'll post more. The debug returns "Reassignee ID: null"

Controller:
public class Advanced_Approval {
public Apttus_Approval__Approval_Request__c reassignee {get;set;}
User reassignedToUser = new User();
public void userPopulated()
         {
         reassignee = new Apttus_Approval__Approval_Request__c();
         system.debug('Reassignee ID: ' + reassignee.Apttus_Approval__Assigned_To__c);
         reassignedToUser = [select id, Name From User Where id=:reassignee.Apttus_Approval__Assigned_To__c];
         }
}

Visualforce Page:
<apex:outputLabel value="Reassign To " for="assigned" style="font-weight:bold; margin-left 15%" ></apex:outputLabel>
  <apex:actionRegion > 
    <apex:inputField id="assigned" value="{!reassignee.Apttus_Approval__Assigned_To__c}">
      <apex:actionSupport event="onchange" action="{!userPopulated}" rerender="FinancialAidPanel shopDetailSection" />
    </apex:inputField>
</apex:actionRegion>

 
Best Answer chosen by Matt Cooper 7
Matt Cooper 7Matt Cooper 7
Fixed my issue by moving the "
reassignee = new Apttus_Approval__Approval_Request__c();" into the constructor.