2011-12-12 78 views
0

我無法正確處理引用以下調用的正確方法,因此無法正確呈現。 '作爲after =「」的參數被調用,我不能在其中使用雙引號,因此$ {pictureInThread.id}被逐字呈現而不是被調用。如果我將單引號更改爲double,則它將作爲它早=」後結束。在GSP中嵌套grails函數調用的語法(以{{remoteFunction}中的動態值作爲<g:remoteLink>的參數)

注我已刪除了其它參數在下面的例子是爲了可讀性目的remoteLink。

<g:remoteLink after="${remoteFunction(controller:'voting',action:'computeScore',update:'${pictureInThread.id}')}"> 

回答

1

您是否嘗試過:

<g:remoteLink after="${remoteFunction(controller:'voting',action:'computeScore',update:pictureInThread.id)}"> 

既然你已經在Groovy腳本塊,你應該能夠直接引用變量。