You need to sign in to do that
Don't have an account?
VFP using pageblock table is not saving when i am using some filter
VFP:
<apex:page standardController="Account" extensions="AccountPageblock" recordSetVar="records" id="thePage">
<apex:form id="theForm">
<apex:pageBlock id="thePageBlock">
<apex:pageBlockTable value="{!records}" var="record" id="thePageBlockTable">
<apex:column >
<apex:inputField value="{!record.Name}" id="AccountNameDOM" />
<apex:facet name="header">Name</apex:facet>
</apex:column>
<apex:column >
<apex:inputField value="{!record.Type}" id="AccountTypeDOM" />
<apex:facet name="header">Type</apex:facet>
</apex:column>
<apex:column >
<apex:inputField value="{!record.Industry}"
id="AccountIndustryDOM" />
<apex:facet name="header">Industry</apex:facet>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" id="saveButton" />
<apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Contoller:
public class AccountPageblock {
public AccountPageblock(ApexPages.StandardSetController controller) {
}
public List<Account> getrecords() {
return [SELECT Type, Name, Industry FROM Account where Industry =: 'Energy'];
}
public abstract class MyController{
Apexpages.StandardController controller;
public MyController(Apexpages.StandardController c){
controller = c;
}
public PageReference save() {
controller.save();//invoke standard Save method
return Apexpages.currentPage();//refresh current page
}
}
}
Hi,
there are some issues with the way you use the controller extension.
One way I have seen your requirement accomplished is here: http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination/ .
This excellent article explains how to use standardsetcontroller.
I have just played around with the code contained in the article and yours to save records: