You need to sign in to do that
Don't have an account?
Sami Cohen
Here is my Controller:
I have 2 problems:
Paging-Problem
Here is my VisualPage code:
Code:
<apex:page controller="testConCTRL"> <apex:form > <apex:pageBlock > <apex:dataTable value="{!LIST}" var="Prod" > <apex:column value="{!Prod.Name}"> </apex:column> </apex:dataTable> <apex:commandButton value="next" action="{!setcon.next}" ></apex:commandButton> <apex:commandButton value="previous" action="{!setcon.previous}" ></apex:commandButton> </apex:pageBlock> </apex:form> </apex:page>
Here is my Controller:
Code:
public class testConCTRL { List<Product2> p = new List<Product2>(); public ApexPages.StandardSetController setCon { get { if(setCon == null) { setCon = new ApexPages.StandardSetController(Database.getQueryLocator([Select Id, Name FROM Product2])); setcon.setpageSize(5); } return setCon; } set; } public List<Product2> getLIST() { p= new List<Product2>(); p = (List<Product2>) setCon.getRecords(); return p; } }
I have 2 problems:
- The getRecords() actions return just 4 entries although I have more than 10 entries in my Product2 object.
- The next() action returns the same result everytime.
Help would be appreciated.
Checkout this post