Hey. I have this controller:
def participated_favourite = {
def user = User.get(1)
def conferenceUser
def original = ConferenceUser.findAllByUser(user)
def temp = ConferenceUser.findAllByUserAndIsFavourite(user, 1) // all conferenceUser filtered by User
def priz = [:]
def subm = [:]
...
...
[temp: temp, priz: priz, subm: subm, orig: original]
}
I want now to be able to select in a selectBox, the list of conferences passed by ‘original’ (in the participated_favourite.gsp).
How can i do that?
<g:select name="" from="${orig.list()}" optionKey="id" value="" />
This is giving me an empty select box which shouldnt. because there is one record in my database. What am i doing wrong?
Thanks in advances,
EDIT______________
I have in same gsp the folowing:
<g:each var="it" in="${orig}">
<table cellspacing="2">
<tbody><tr>
<th>Name</th>
</tr>
<tr>
<td class="color1">${it.conference}
</td>
</tr>
</tbody>
</table>
</g:each>
And it is p+rinting the values. So i dont know what is the problem in the select..
Try giving the
nameattribute a value.—EDIT —–
Try the following to troubleshoot:
Does this work?
<g:select from="${ConferenceUser.list()}" />If so, how about this?
<g:select from="${ConferenceUser.list()}" optionKey="id" />