我有一个 ListView ,对于每一行,我想要一个链接到另一个显示相关结果的 ListView 。我最终设法构建的 createlink 行看起来像这样
<a href="${createLink(controller : 'RunResults', action:'ListSpecific', params:'[id:testExecQueueInstance.id]')}">my link</a>
这将生成链接
http://localhost:3278/FARTFramework/runResults/listSpecific/testExecQueueInstance.id
我知道 testExecQueueInstance.id 是 22,我希望链接实际上看起来像这样
http://localhost:3278/FARTFramework/runResults/listSpecific/22
我错过了什么?
这个想法是,然后我有一个像这样的 Controller ,然后它应该列出与该 ID 匹配的那些项目......
def ListSpecific(int id){
render(view: "list", model: [runResultsInstanceList: RunResults.findAllByTestExeQueueID(id, [sort:"testExecTime", order: "desc"]), runResultsInstanceTotal: RunResults.count()])
}
最佳答案
您在参数映射上使用撇号。
你应该试试这个。
<a href="${createLink(controller : 'RunResults', action:'ListSpecific', params: [id:testExecQueueInstance.id])}">my link</a>
请享用。
关于grails - 在页面创建时将值插入到 grails createlink 参数中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18785500/