Background I'm working with two VF pages, OutOfOffice and AddNewOutOfOffice. The OutOfOffice page displays a list of custom object records. For each record there is an edit and a delete button. There is also a single 'add new' button at the top the OutOfOffice that links to the AddNewOutOfOffice page.
Issue I need the edit button(s) on the OutOfOffice to link to the AddNewOutOfOffice page and pass the record ID into the URL. However with my current code, when I click the edit button I get the url /AddNewOutOfOffice?id=null
Here's what I have so far for the edit button in the VF Page:
<apex:repeat value="{!OOOrecs}" var="OOO">
<apex:commandButton value="Edit" action="{!EditOutOfOffice}"/>
<apex:param name="oooIdEdit" value="{!OOO.id}" assignTo="{!oooIdEdit}"/>
<apex:commandButton value="Delete" action="{!deleteOOO}" rerender="all">
<apex:param name="oooIdDelete" value="{!OOO.id}" assignTo="{!oooIdDelete}"/>
</apex:commandButton>
<br/><br/>
</apex:repeat>
and controller:
public String oooIdEdit {get;set;}
public PageReference EditOutOfOffice() {
return new PageReference('/AddNewOutOfOffice/?id='+oooIdEdit);
}