I can't seem to get the commandbutton to call a method from my controller. There are no errors, nothing at all in the debug log. The method is just not called for some reason.
Apex:
String documentCategory {get;set;}
String documentType {get;set;}
String documentId {get;set;}
public void deleteDocument(){
system.debug('VISUALFORCEPARAMS' +documentType + documentCategory + documentId);
hardDeleteDocument(account.Business__c, account.Customer_Number__c, documentCategory, documentType, documentId);
}
Visualforce:
<apex:page id="mypage" controller="mycontroller">
<apex:tabPanel >
<apex:tab label="Search Documents" id="searchDoc">
<apex:form >
<apex:pageMessages />
<!-- search inputs -->
<apex:commandButton action="{!searchRecords}" value="Search"></apex:commandButton>
<apex:pageBlock >
<apex:pageBlockTable value="{!foundDocuments}" var="doc">
<apex:column headerValue="action">
<apex:commandButton value="View" />
<apex:commandButton value="Download" />
<apex:commandButton value="Delete" action="{!deleteDocument}" >
<apex:param value="{!doc.category}" name="docCategory" assignTo="{!documentCateogry}"></apex:param>
<apex:param value="{!doc.type}" name="docType" assignTo="{!documentType}"></apex:param>
<apex:param value="{!doc.fileId}" name="fileId" assignTo="{!documentId}"></apex:param>
</apex:commandButton>
</apex:column>
<!-- other columns -->
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:tab>
<!-- other tabs -->
</apex:tabPanel>
</apex:page>
apex:pageMessages
to your page and rerender it on button click. There could be a some client side validation.commandButton
tocommandLink
.