我有一个控制器给我一个对象列表
def historyInstance = History.findAllByPatient(patientInstance)
def total = historyInstance.size()
[historyInstanceTotal: total,historyInstanceList: historyInstance]
我不在 historyController 中,但我想在视图上分页,每页最多 3 个对象
<g:paginate total="${historyInstanceTotal}" />
但似乎我需要参数,但我不能使用它,因为结果是错误的任何想法我该如何解决这个问题?
主意
也许<g:paginate>不知道要分页什么,我如何链接这两个(<g:paginate>和historyInstanceList)以便正确分页,我想到了这个观看generate-all以及 grails 是如何做到的。