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
Steven Berg 5Steven Berg 5 

Param value in VF is passing old value to controller in a repeat variable

I have a visualforce page using a repeat (c variable)
I am trying to update the inputtext value = "{!c.name}" 

if the value is  Bob, I want to change it to Jim via an input field and have Jim passed  as a value to my controller .
When I hit the custom Submit button which is a page reference on my controller
Bob is passed to the controller not Jim.

Do I need to do something in the code  so a setter is fired or some kind of page refresh? Thank You

<label style="padding-Right:20px" >Account Name:</label>
 <apex:actionRegion>
 <apex:inputtext label="Account Name:" value="{!c.Name}" id="AccountNameId">
 <apex:actionSupport event="onchange"
       action="{!doActionSupport}"
       reRender="refresh">
<!-- <apex:param value="{!c.name}" Name="myName" assignto="{!myName}"/> -->
<apex:param value="{!c.name}" Name="myName" assignto="{!myName}"/>
 </apex:actionSupport>
 </apex:inputtext>
 </apex:actionRegion>


Controller code:
public PageReference doActionSupport() {
      
    system.debug('doActionsupport activated ' );
    
    String myBigName = ApexPages.currentPage().getParameters().get('myName');
    
    
    System.debug('myBigName in doActionSupport is ' + myBigName); // Shows Bob not Jim
    System.debug('myName in doActionSupport is ' + myName); // Shows Bob not Jim
    
  
    return null;

my VF page:

<label style="padding-Right:20px" >Account Name:</label>
 <apex:actionRegion>
 <apex:inputtext label="Account Name:" value="{!c.Name}" id="AccountNameId">  // c.Name has been changed form Bob to Jim on the vf page
 <apex:actionSupport event="onchange"
       action="{!doActionSupport}"
       reRender="refresh">
<apex:param value="{!c.name}" Name="myName" assignto="{!myName}"/>  // myName has the old value of Bob not the new value of Jim
 </apex:actionSupport>
 </apex:inputtext>
 </apex:actionRegion>