Extension:<apex:form id="votingSection">
<apex:pageBlock mode="edit">
<apex:pageBlockButtons location="bottom">
<apex:commandButton styleclass="btn-lg btn-data" value="Vote Up" action="{!voteUp}" reRender="votingSection"/>
<apex:commandButton styleclass="btn-lg btn-data" value="Vote Down" action="{!voteDown}" reRender="votingSection"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
Any ideas on how to make this work? Also, I'm trying to figure out how to implement unique votes by user. Thanks!public class detExt2 {
private final my_object__c myObject;
public detExt2() {
myIdea = [SELECT Id, Vote_Button__c, Name FROM my_object__c
WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
}
public my_object__c getObject() {
return myObject;
}
public PageReference voteUp() {
myIdea.Vote_Button__c = 'Up';
update myObject;
return null;
}
public PageReference voteDown() {
myIdea.my_object__c = 'Down';
update myObject;
return null;
}
}