Binding multiple objects in Grails
Posted
by WaZ
on Stack Overflow
See other posts from Stack Overflow
or by WaZ
Published on 2010-03-15T09:39:10Z
Indexed on
2010/03/15
10:09 UTC
Read the original article
Hit count: 175
grails
I have there domain classes:
:: Person. (Person.ID, Name,Address) :: Designation.(Designation.ID, Title, Band) :: SalarySlip (Person.ID, Designation.ID, totalIncome, Tax etc etc.)
In the update method the person controller when I assign a person a designation from a list of designation values I want to insert a new record inside SalarySlip.
Something like:
def update = {
def SalarySlipInstance = new SalarySlip()
SalarySlipInstance.Person.ID = Params.ID //is this correct?
SalarySlipInstance.Designation.ID = ?? //since the value is coming from a list. How can I bind this field?
}
Much Appreciated,
Thanks,
WB
© Stack Overflow or respective owner