+ Start a Discussion
Nick KahnNick Kahn 

Accessing inputField Values Created Inside apex:repeat

I need help in getting values from VF component page, just for the sake of clarity I have added very few fields to make my point across.
How to access inputField values that are created inside an apex:repeat.
When I do system.debug('updateMe >>>' + detailList) I see there is old data but NOT the updated value.
Here is the code snippet
VF Component:

  <apex:attribute name="record" description="my custom object" type="meter__c" required="true" />  

    <!-- more fields -->
         <apex:inputField value="{!record.meter_reading__c}"/>
         <apex:inputField value="{!record.desc__c}"/>
VF Page:

<apex:page Controller="MeterReading" >
  <apex:form > 
         <apex:repeat value="{!detailList}" var="detail"> 
            <c:meter_vf_comp record="{!detail}" />
   <apex:commandButton value="Save" action="{!updateMe}"/>

public with sharing class MeterReading 
  public List<meter__c> detailList { get; set; }

public MeterReading() 
   detailList = [/*SOQL*/];  //loading the data and display in repeat...

public PageReference updateMe() {
    system.debug('updateMe >>>' + detailList);  
    return null;


James LoghryJames Loghry
It should all be passed by reference in such that you can iterate through detailList and grab the right information..
public PageReference updateMe(){
    for(Meter__c m : detailList){
        //This should show the same values the user entered in VF..
    update detailList;