嘿。我有这个控制器:
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]
}
我现在希望能够在 selectBox 中选择“原始”通过的会议列表(在参与的_favourite.gsp 中)。
我怎样才能做到这一点?
<g:select name="" from="${orig.list()}" optionKey="id" value="" />
这给了我一个不应该的空选择框。因为我的数据库中有一条记录。我究竟做错了什么?感谢提前,
编辑_ _ __ _ __ _ __ _ __ _
我在相同的 gsp 中有以下内容:
<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>
它是 p+rinting 值。所以我不知道选择中的问题是什么..