I am new in salesforce development.I am started learning visualforce. Please help to resolve this issue.
Vf page :
<apex:page controller="UpdateOpportunity">
<apex:form>
<apex:pageBlock title="Opportunity_list">
<apex:pageBlockTable value="{!OpptyDetail}" var = "opporty">
<apex:inputField value = "{!opporty.Name}"/>
<apex:inputField value = "{!opporty.StageName}"/>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton action="{!Save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Class:
public class UpdateOpportunity {
public List<Opportunity> getOpptyDetail(){
List<Opportunity> opptylist =[SELECT Id,Name,StageName FROM opportunity WHERE StageName = 'Prospecting'];
return opptylist;
}
}
It's thrown error:Unknown method UpdateOpportunity.Save()
PageReference save() {..do the DML}
method in the custom controller as Hengky stated