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

Possible bug in StandardSetController setPageNumber
if I call
var.setPageNumber(integer.valueOf(ApexPages.CurrentPage().getParameters().get('pgNum')));
IT ALWAYS sets the pagenumber to 1 regardless of what the apexPages parameter
If I However do:
Public Integer tstPg = integer.valueOf(ApexPages.CurrentPage().getParameters().get('pgNum')));
var.setPageNumber(txtPg);
it sets the page just fine no matter what the ApexPage Parameter is. If it is 2, the page is set to 2
Any one have any ideas?
I've had this happen if I haven't set the PageSize.
<pre>
ssc.setpageSize(somePgSize);
ssc.setpageNumber(somePgNumber);
</pre>
This makes sense in that without knowing the pageSize to apply to the ssc result list, the pageNumber is meaningless - That is, if pagesize = 20, setting pagenumber to 2 will start at record 21st in the list but if pageSize is unknown, what does pageNumber 2 mean? Now, one could argue that these values should be order independent as it is the getRecords() method call that matters but the implementation does not appear to work this way. I've filed a request to have the doc updated