您的位置:首页 > 其它

sf中标准的分页功能介绍

2016-09-13 15:44 190 查看
  世上本无事,庸人自扰之。我喜欢一个相对比较安静的环境去学习和工作,希望在一个掉一根针的声音都能够听到的环境中,但是有时候往往相反,一片嘈杂,我改变不了周围的环境,只能改变自己,其实这些都没有什么,也许是我内心就很嘈杂,使我听到一点点声音就感觉很烦躁。上善若水,心静则情静继而人静。

  言归正传:

  sf中标准的分页功能:

  sf有自己标准的分页功能,sf真是个功能相当完善的云端开发平台,其有好多自己标准的功能,今天我就根据自己的理解先介绍一下sf标准的分页功能的皮毛。

  

定义关联到前台的Contet值
public ConstructionMethod(){
Contet=(List<letterInfo__c>) con.getRecords();
}
public ApexPages.StandardSetController con{
get {
if(con == null) {
con = new ApexPages.StandardSetController(letterInfoList);
// sets the number of records in each page set
con.setPageSize(5);
}
return con;
}
set;
}
List<letterInfo__c> Contet;
public List<letterInfo__c> getContet(){
return (List<letterInfo__c>) con.getRecords();
}
// indicates whether there are more records after the current page set.
public Boolean hasNext{
get {
return con.getHasNext();
}
set;
}
// indicates whether there are more records before the current page set.
public Boolean hasPrevious{
get {
return con.getHasPrevious();
}
set;
}
// returns the page number of the current page set
public Integer pageNumber{
get {
return con.getPageNumber();
}
set;
}
// returns the first page of records
public void first(){
con.first();
}
// returns the last page of records
public void last(){
con.last();
}
// returns the previous page of records
public void previous(){
con.previous();
}
// returns the next page of records
public void next(){
con.next();
}
// returns the PageReference of the original page, if known, or the home page.
public void cancel(){
con.cancel();
}

integer totalPage;
public integer getTotalPage(){
return (integer)Math.ceil((double)letterRead.size()/5.00);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: