Created
February 23, 2013 09:18
-
-
Save vmencik/5019094 to your computer and use it in GitHub Desktop.
Initialization of PaginationData before it is passed to a template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Pagination { | |
def apply[T](page: ListPage[T], pageSize: Int)(navi: Int => Call): PaginationData = { | |
val pd = new PaginationData | |
pd.setPageSize(pageSize) | |
pd.setRunover(page.runover) | |
pd.configure(page.totalCount, page.firstIndex) | |
pd.setAddressAdapter(new PageAddressAdapter { | |
override def makePageAddress(offset: Int): Call = navi(offset) | |
}) | |
pd | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment