I am having trouble getting the Id from the selected record to pass to my controller. When I check my debug the value of "accId" reports back as NULL.
Here is my VF Page (code trimmed):
<apex:page controller="controller_AccountServicing" sidebar="false">
<apex:form id="theForm">
<div id="header">
<b>Account Servicing Activities (This Week)</b>
</div>
<div id="section" >
<apex:pageBlock id="thePage">
<apex:pageBlockTable value="{!Activities}" var="acc" id="Detail" >
<apex:column style="align:center;text-align:center;">
<apex:facet name="header">Activity Name</apex:facet>
<apex:outputlink target="_blank" value="/{!acc.Id}">{!acc.Name}</apex:outputlink>
</apex:column>
<apex:column >
<apex:commandButton value="Update" action="{!updateWindow}">
<apex:param name="activityId" assignTo="{!accid}" value="{!Acc.Id}"/>
</apex:commandButton>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</div>
</apex:form>
</apex:page>
Here is my controller (code trimmed):
public class controller_AccountServicing {
//Create Variables
list <Account_Servicing_Activity__c> accActivities = new list<Account_Servicing_Activity__c>();
public boolean renderPrompt {get;set;}
public Id accId {get;set;}
public controller_AccountServicing(){
//Initilization items
Id currentuser = system.UserInfo.getUserId();
}
public List<Account_Servicing_Activity__c> getActivities() {
accActivities = [Select Id,Name,(OTHER FIELDS)
FROM Account_Servicing_Activity__c
];
return accActivities;
}
public void updateWindow() {
renderPrompt = TRUE;
system.debug('Activity ID = ' + accId);
}
public void updateRecord() {
try {
renderprompt = false;
} catch(DmlException e) {
ApexPages.addMessages(e);
System.debug('The following exception has occurred: ' + e.getMessage());
}
}
}