You need to sign in to do that
Don't have an account?

Saving selected records using custom list controller
<apex:page controller="opportunityList2Con"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> </apex:pageBlockButtons> <apex:pageMessages /> <apex:pageBlockTable value="{!opportunities}" var="opp"> <apex:column headerValue="Managers Feel"> <apex:inputField value="{!opp.Manager_Feel__c}"/> </apex:column> <apex:column value="{!opp.StageName}"/> <apex:column value="{!opp.CloseDate}"/> <apex:column > <apex:facet name="header" ><b>Name</b></apex:facet> <apex:outputLink value="/{!opp.id}" > {!opp.name} </apex:outputLink> </apex:column> <apex:column value="{!opp.Owner.Name}"/> <apex:column value="{!opp.Account.Name}"/> <apex:column value="{!opp.Amount}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
and here is the controller. I am not sure how the save should be coded...
public class opportunityList2Con { public PageReference save() { return null; } public ApexPages.StandardSetController setCon { get { if(setCon == null) { setCon = new ApexPages.StandardSetController(Database.getQueryLocator([select id, name, account.name, stagename, Manager_Feel__c, closedate, amount, owner.name from Opportunity where ownerid = '00530000000jMqE'])); } return setCon; } set; } public List<Opportunity> getOpportunities() { return (List<Opportunity>) setCon.getRecords(); } }
Hi... In the controller you need to create save method lik "public pagereference save() { /*your code here*/}". In the save method cut the logic in your controller and paste it into the save method. Then it works fine