0

おい。私はこのコントローラーを持っています:

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で、「original」(particeded_favourite.gsp内)によって渡された会議のリストを選択できるようにしたいと思います。

どうやってやるの?

<g:select name="" from="${orig.list()}" optionKey="id" value=""  />

これは私に空の選択ボックスを与えています。私のデータベースには1つのレコードがあるからです。私は何が間違っているのですか?よろしくお願いします、


編集_____ __ _ __ _ __ _ _ _

私は同じ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しています。だから私はselectの問題が何であるかわかりません。

4

2 に答える 2

0

使用する

<g:select name="" from="${orig}" optionKey="id" value=""  />
于 2011-05-28T17:24:45.070 に答える
0

name属性に値を付けてみてください。

- -編集 - - -

トラブルシューティングするには、次のことを試してください。

これは機能しますか?

<g:select from="${ConferenceUser.list()}" />

もしそうなら、これはどうですか?

<g:select from="${ConferenceUser.list()}" optionKey="id" />

于 2011-05-28T17:38:39.640 に答える