• Dharmendra Kushwah
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

Hi All,

I am using on <apex:actionSupport> on an InputField, and on change of field value, i am passing InputField value to controller using <apex:param>. However the issue is, in controller, iam not getting latest InputField value. Please see below simpler code snippet:

VF page:
<apex:page controller="testcontroller">
     <apex:form >
             <apex:inputField value="{!acct.name}" >
                 <apex:actionSupport event="onchange" action="{!setvar}" reRender="">
                     <apex:param name="setvar" value="{!acct.name}" assignTo="{!var}"/>
                 </apex:actionSupport>
             </apex:inputField>
      </apex:form>
</apex:page>

Controller:
public class testcontroller{

    public String Account { get; set; }

public Account acct{get;set;}
public string var{get;set;}

    public testcontroller(){
        acct = new Account();
    
    }
    
     public void setvar(){
     
        system.debug('var#####'+var);
    
    }
}

Please help me out, if there is any other way to pass this latest field value on change to Controller.

Thanks