如何在 Grails 中的 g:actionSubmit 中添加参数

问题描述 投票:0回答:2
grails
2个回答
1
投票

https://grails.github.io/grails-doc/3.0.x/ref/Tags/actionSubmit.html

g:actionSubmit 标签中不能添加参数。 尝试这样:

<g:textArea name="review"/>
<input name="gameId" value="${game.id}" type="hidden" />
<input name="gameTitle" value="${game.gameTitle}" type="hidden" />
<g:actionSubmit action="addReview" value="Add Review" class="ui blue labeled submit icon button">
          <i class="icon edit"></i> Add Review
 </g:actionSubmit>

0
投票

答案并不明显,但可以做到......

<input type="submit" value="Add Review" formaction="addReview?gameId=${game.id}" class="ui blue labeled submit icon button"/>
© www.soinside.com 2019 - 2024. All rights reserved.