在通过g:render传递数据到另一个视图时遇到了问题,该视图包含在printme.gsp中
printme.gsp:
<h1>abc</h1>
${input1Instance?.number} <!-- Here I can see the right value -->
<g:render contextPath="../input1" template="form"/>input1/_form.gsp:
<!-- Here there is no value set -->
<g:textArea maxlength="1000" name="number" value="${input1Instance?.number}"/>如何将对象从printme.gsp传递到input/_form.gsp?
谢谢。
发布于 2013-05-29 06:16:42
您必须将数据作为模型显式传递:
<g:render contextPath="../input1" template="form" model="[input1Instance:input1Instance]"/>然后,您可以从模板中访问它
https://stackoverflow.com/questions/16802340
复制相似问题