I have something like this:
<g:each in="${temp}">
<li>Date: ${it.dateParticipated}, <br>Role: ${it.role}, <br>Acceptence: ${it.accepted}, <br>
<g:link controller="conference" action="participated" id="${it.conference.id}">
Conference: </g:link>${it.conference},<br>
Role: ${it.role}, <br>Status: ${it.status}</li><br>
<br>
</g:each>
What i want to do is, when i click on 'Conference', the controller 'conference' with the method 'participated' is loaded, and the params 'it.conference' is passed. How can i pass this params in the g:link tag ?
I need this because, when i click in the 'conference' word, other page is loaded with the conference details with the id passed.
Use the params attribute to pass in a map of parameters:
<g:link action="/conference/participated" id="${it.conference.id}" params="[foo: 'bar', bar: 'foo']">My Link!</g:link>
See the documentation for more examples.
You need to wrap your entire params with ${ }, instead of wrapping every variable that you want to pass separately.
<g:each in="${temp}">
<li>Date: ${it.dateParticipated}, <br>Role: ${it.role}, <br>Acceptence: ${it.accepted}, <br>
<g:link controller="conference" action="participated" params="${[id: it.conference.id, role: it.role, status: it.status]}">
Conference: </g:link>
<br>
</g:each>
params="[customerId: customer.id]"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With