+ Start a Discussion
Thomas D.Thomas D. 

inputfield value not being updated to controller

I'm using a visualforce page and a custom controller to save some inputfields from inputfields in a repeater.. however the new inserted values are not being updated.

when i edit the inputcheck or inputfield and then press the command button to call my apex controller method. it doesn't pass the newly entered values and just updates again with the old values.

In case i didn't give enough code detail i can give more.

Page:
<apex:page controller="customController" >
    <apex:form>
        <apex:actionFunction action="{!closepopup}" name="closepopup" reRender="popup" oncomplete="restorescroll()">
        </apex:actionFunction>
    </apex:form>
    
    <apex:outputPanel id="popup">
        <apex:outputPanel id="outerpopup" styleClass="popupBackground" layout="block" rendered="{!displayPopUp}" onclick="closepopup()"/>
        <apex:outputPanel id="innerpopup" styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
            <div class="popupoverflow">
                <div class="popupcontent">
                    
                    {!fullcard.Name}<br/><br/><br/>
                    <apex:form >
                        <apex:repeat value="{!relatedworks}" var="rw">
                            <apex:inputCheckbox value="{!rw.Completed__c}"/>
                            <apex:inputField value="{!rw.name}">
                            </apex:inputField>
                            
                        </apex:repeat>
                        <apex:commandButton value="Hide Pop up" id="closebutton" action="{!closePopup}" rerender="popup"/>
                    </apex:form>
                    <chatter:follow entityId="{!cardId}"/>
                    <chatter:feed entityId="{!cardId}"/>
                </div>
            </div>
        </apex:outputPanel>
    </apex:outputPanel>
</apex:page>

Controller:
 
public list<VG_FR_Work__c> relatedworks {get;set;}
public string CardId {get;set;}
public boolean displayPopup {get; set;}

public void closePopup() {
        update relatedworks;
        displayPopup = false;
}

public void showPopup() {
        fullcard = [SELECT Id,Name,status__c,Long_description__c FROM VG_FeatureRequest__c WHERE Id =: cardId];
        relatedworks = [SELECT Id,Name,completed__c FROM VG_FR_Work__c WHERE VG_FeatureRequest__c =: cardId ];
        displayPopup = true;    
 }

 
Thomas D.Thomas D.
Edit: the onclick on the outputpanel doesn't save the newly entered values.