I am generating textFields from a list of questions
For loop:
<g:each var="${question}" in="${review.questions}">
Generating textField and assigned the id to the name so I can save many questions at once on the controller.
<g:select from="['','Yes','No']" name="questionResponse_${question.id}" class="span2" value="${question.response ?: ''}" />
I want to set the value of the select list from the params object.
So I would like to do something like
value=${params.questionResponse_${question.id} ?: question.response}
How do I go about doing this? Can anybody help me out with this? I would really appreciate it.
Not sure if is that what you want but params['
questionResponse_ '+question.id] works?
On Mon, Jun 11, 2012 at 6:50 AM, bhushan154 <[hidden email]> wrote:
Hi All,
I am generating textFields from a list of questions
For loop:
<g:each var="${question}" in="${review.questions}">
Generating textField and assigned the id to the name so I can save many
questions at once on the controller.
<g:select from="['','Yes','No']" name="questionResponse_${question.id}"
class="span2" value="${question.response ?: ''}" />
I want to set the value of the select list from the params object.
So I would like to do something like
value=${params.questionResponse_${question.id} ?: question.response}
How do I go about doing this? Can anybody help me out with this? I would
really appreciate it.