I want to render same template on one page which should display the value depending on the param value(3 or 4). View is --
<td >
<g:render template="gdxqStatusTemplate" model="[param:3]" /> </td>
</td>
<td> </td>
<td >
<g:render template="gdxqStatusTemplate" model="[param:4]" /> </td>
</td>
Controller has -
[ total3:totalValue3,total4:totalValue4]
how to show the appropriate value of total in template code -
<table >
<tr ><td class="InputText" nowrap><b> MessageQ Status,/td>
<tr> <td class="NoLight" nowrap>Total MessageQ : ${total+params}***/* IT SHOWS "total4" NOT THE VALUE.*/***
</td></tr>
<tr height=30></tr>
</table>
Yo must change:
<g:render template="gdxqStatusTemplate" model="[param:3]" />
By
<g:render template="gdxqStatusTemplate" bean="${total3}" />
And in your template replace:
<td class="NoLight" nowrap>Total MessageQ : ${total+params}</td>
By:
<td class="NoLight" nowrap>Total MessageQ : ${it}</td>
For documentation check: http://grails.org/doc/2.0.x/ref/Tags/render.html
Do you know that you can use arrays or objects here? like
model: [total: [null, null, totalValue3, totalValue4]]
and use as
<td class="NoLight" nowrap>Total MessageQ : ${total[params]}</td>