When I call the function from a button on a visualforce page using the controller I get
Unknown Property 'ContractDetails.save'
when I am trying to save the vfp.
Controller:
public class ContractDetails{
public Opportunity ThisOpportunity{get;set;}
public string oppid {get;set;}
public ContractDetails(){
oppid = ApexPages.currentPage().getParameters().get('id');
if(oppid==null){
oppid = ApexPages.currentPage().getParameters().get('oppidd');
}
ThisOpportunity = [Select Contract_Requested__c FROM Opportunity where ID=:oppid];
}
public void save(){
ThisOpportunity.Contract_Requested__c = boolean.valueOf('True');
system.debug(ThisOpportunity.Contract_Requested__c);
update ThisOpportunity;
}
Button on VFP:
<apex:page controller="ContractDetails" showHeader="false" standardStylesheets="false" sidebar="false" docType="html-5.0" >
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<apex:slds />
<script type="text/javascript">
function requested(){
requestedoper();
}
</script>
<apex:form id="wf">
<button class="slds-badge" style="{!requested}" onclick="requested()">Requested</button>
<apex:actionfunction action="{!save}" name="requesteoper" rerender="wf"></apex:actionfunction></apex:form>
</html>
</apex:page>
controller
orextensions
attributes of<apex:page>
properly, but I can't say for certain unless you share more of your code & visualforce markup. You don't need to share everything, but, at the minimum, seeing the first line(s) of your controller class (i.e.public class Something{
) and the first line (<apex:page ...>
) of your visualforce would be helpful. – Derek F Jun 30 '17 at 17:27