我正在尝试在 GSPg:select
中选择第一个组合框 () 值时加载第二个组合框 () 值。g:select
领域类:
class Person {
String name
static hasMany = [telephones:Telephone]
}
class Telephone {
String tNumber
Person person
static belongsTo = [person:Person]
}
普惠制:
<td>
<g:select id="person" name="selectedPersonId" from="${Person.list(sort:name, order:asc)}" value="name" optionValue="name" optionKey="id" noSelection="['0':'--Select--']" />
</td>
<td>
<g:select id="telephone" name="selectedTelephoneId" from ="${person.telephones}" value="tNumber" optionValue="tNumber" optionKey="id" noSelection="['0','--Select--']"/>
</td>
我怎样才能正确地做到这一点?