I am trying to do inline editing on a vf page with a customController but I can't seem to get any data to pass to the controller on clicking on the save button.
VF Page:
<apex:form id="makeEdit">
<apex:repeat var="oppProductInfo" value="{!oppLineItems}">
<table id="lineItemTable">
<tbody>
<tr class="displayNone">
<td colspan="5">
<div class="twoColumns" style="height: 61px;">
<apex:outputLabel value="Version:" for="picklistHeader" />
<br />
<apex:outputfield value="{!oppProductInfo.Product2.Version__c}" styleClass="removeDefault picklistHeader" id="picklistHeader">
</apex:outputfield>
</div>
<div class="twoColumns">
<apex:outputLabel value="Term: # Years:" for="termYear"/>
<br />
<apex:outputfield value="{!oppProductInfo.Term_Years__c}" styleClass="removeDefault termYear" id="termYear">
<apex:inlineEditSupport showOnEdit="saveEdit, cancelEdit" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
</apex:outputfield>
</div>
</td>
</tr>
</tbody>
</table>
<apex:commandButton id="saveEdit" value="Save Changes" action="{!updateRecord}" rerender="makeEdit" status="updatingRecord" styleClass="newButton floatRight">
<apex:param name="termYear" value="{!oppProductInfo.Term_Years__c}" assignTo="{!termYear}" />
</apex:commandButton>
</apex:repeat>
</apex:form>
Controller Code:
public String termYear { get; set; }
public PageReference updateRecord(){
OpportunityLineItem pli = new OpportunityLineItem();
pli.Id = curId;
pli.Term_Years__c = termYear;
try{
update pli;
System.debug('Update Successful');
} catch (Exception e){
System.debug(e.getMessage());
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage());
ApexPages.addMessage(msg);
}
return null;
}
Would someone mind pushing me in the right direction? I feel I might be doing something really stupid :/
Update:
I also debugged "termYear" to the console and it's just showing as the previous value